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

Solution Link - CodeChef: Practical coding for everyone

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

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

Thank you, brother. It is working now .