TLE in Deepak and Primes II

Why my solution doesnt pass all test cases.