Test Cases not passed

My first and second test cases are not being passed. Please help!

Plz send your code by saving on ide so that we could check it.

Plz use prime seive optimisation in your code for checking for prime, You can refer to online video lecture given in number theory for the same.