Can anyone provide a testcase where my soln is failing...

Question : https://www.codechef.com/NPLQ2018/problems/NPLQ18C

My soln: https://www.codechef.com/viewsolution/20279021

???.

Yes. You seemed to have over-interpreted the requirements; given n, you have to give (if possible) a prime p that is greater than or equal to n and between \ell and r. What it doesn’t say is that p must be close to n. So given:

1
90 112 3
6
100
110

the output should be:

97
101
-1