Only 1 test case left

u have posted the wrong code

the solution and the question differs, please check it out.

Someone Please check

just change int to long long int

and dont do x=x%p. this step is completely wrong