Comments

can anyone explain this line in problem E

Now moments of time are up to 6·10^5

constrains for l and r are up to 10^9 then why 6* 10^5 ?

can you tell how this recurrence came?

dpA[n] = dpA[n-1]*(A-1) + dpB[n-1]*A
dpB[n] = dpA[n-1]*B + dpB[n-1](B-1)

we can make one element equal . you can make ( 0 3 , 1 2 , 2 1 , 3 0 ) max no. of equal element = 1;

Can you explain how we get one possibility with all elements equal? `` in question, we have to find max no. of elements we make equal after operations not possibilitys.

in 1 2 it is impossible to get ans = 2( because we cant make both elements equal ) so ans is 1