What was the question EVIL PROFESSOR asking to do ?
How is the contribution n*(n-1)/2 if s[i]=s[i+1] ?
1 Like
See my example.
Do you have proof for problem 3 (div 2)?
hey @hello_hell problem 3 (div 2) can be done as :
Given : M = A * N + d
Rearranging : M = d * (A * N / d + 1)
Since d is divisor of N
We see that d has to be one of the factors of M
So, we find all the factors and check one by one .
You can refer to solution here - > CodeChef: Practical coding for everyone
: )
1 Like
thanks, actually i missed that d is factor of N , now i got it.