Prime visit question problem

i m facing time limit problem plz turn on to collaborative mode

You have to use prime seive optimisation as given in online video lecture so as to prevent TLE problem