Deepak loves prime problem

code is running successfully in local compiler but only one test case is showing wrong answer
not able to find any mistake
link to the code

@soorya19k sorry for replying late actually i was having some techniqual issue.
in this problem constraints are upto 5000000 and 5000000th prime number lies around 10^8 so check for prime upto10^8, you are checking upto 5*10^6 only.