Here is My solution:https://www.codechef.com/viewsolution/18687071 For Loc may problem DSERIES asked 29 May '18, 20:52

The constraints on N are upto 10^10 . So everytime you multiply by some factor of N you need to first take modulo . Specifically this line in your code lead to WA .
Have a look at the modified version of your solution. answered 30 May '18, 17:32

Thankss :) answered 02 Jun '18, 11:18
