Codeforces celebrates 10 years! We are pleased to announce the crowdfunding-campaign. Congratulate us by the link https://codeforces.com/10years. ×

### Storm_Stark's blog

By Storm_Stark, history, 6 months ago, , # Cherries Mesh:

## Logic:

use Kruskal to find mst of different components, then suppose there are K component then we require k-1 connection of 2 to connect them. answer=sum of mst of min wt of diff component+(k-1)*2;

## code:

https://shashankmishracoder.wordpress.com/2019/08/25/125/

# Street Checkers

## logic:

1. number =2^p1*3^p2*5^p3......... 1.total number of factors=(p1+1)*(p2+1)*....
2. total odd factors(X)=(p2+1)*()...
3. total even factor=(p1+1)X-X=p1*X;
4. diff=(p1-1)*X;
5. if p1=0 -x>=-2 so 1 or prime number
6. if p1=1 diff=0
7. if p1=2 X<=2 so 4 or prime
8. if p1=3 then only 8 is possible
9. calculate if number is prime from L to R(using segmented sieve) the use above conditions.

## code:

#### Can anyone help? 2019, Comments (14)
 » Ratio might cause precision issues, instead cross multiply and compare