Deepak_and_primes

here is the link for my code


i am passing all the test cases except the last one.
i am getting tle in the last case ,can u suggest a way to optimise the code.

are u using segmented sieve ??

fails on big test cases
999900000 1000000000