COPRIMEX : Lunchtime ,need help

Here is the question. Getting TLE in the code. Please help in optimizing the code.

It was a trick question you just need to print a prime that is greater than 1000000 and that’s the ans for all test cases. Simply print 1000003 for all test cases. And please specify about which question u are asking I have written the answer with respect to coprimex which was the first question of div 2.

1 Like

thanks for the help , asking for the same question.

1 Like

got the point , all that are less will not have that single prime which will make the number greater then 1000000 , . Nice approach.

1 Like