i have used sieves of eratosthenes in this question, but one of the test case is not passing, i had also tried to increase the size of sieves but then it starts throwing TLE. please suggest me some way to solve this question or some other ways to solve question like this.
thank you