Encountering tle

I’m facing tle problem even after using prime sieve. Please point out the fault in the code.

Hi @Akshita99
u need not compute the prime array for each test case

take a look at the following code