Doubt in prime visit

my code is giving only one testcase as correct:
TESTCASE # 1 : correct (Time: 0 s)
TESTCASE # 2 : wrong-answer (Time: 0 s)
TESTCASE # 3 : timelimit (Time: 5.97 s)
please help me solve it further.

Shubham, you are supposed to solve this question using prime seive optimisation. You can refer to the video lecture given in Number theory on prime seive optimisation.

1 Like