Time limit case in prime visits problem

time limit case in prime visits problem

Plz use prime seive optimisation in your code as given in online lecture of your course and then try to implement it.