Primality testing getting one WA

my code:
https://ide.codingblocks.com/s/75765

question link:
https://hack.codingblocks.com/contests/c/668/726

same occured for me also. as i have used Miller rabin test. last test case is failing ? Can someone help