GUZAC wrong answer ? Please help where my program is failing in any test case ?

Solution Link - https://www.codechef.com/viewsolution/19815789

you have taken every variable as int while constraint says n ans Pi go upto 10^9.

try changing variables to long long

1 Like

Thank you, brother. It is working now .

In case you still need a tricky test case , here is one !