primes2 W.A.

getting W.A. in the problem: PRIMES2 Problem - CodeChef. My solution link is as: CodeChef: Practical coding for everyone. Wud anybody suggest me where I’m getting wrong. It will be better if anybody can provide me the test cases where my code is failing…
Thanks…