"Prime Visit" Private Test Cases Failing

Problem Link: https://hack.codingblocks.com/contests/c/528/63

My solution: https://ide.codingblocks.com/#/s/28356

The code fails for two private test cases. I am unable to figure out why.

It took time to figure it out
mistake is in line 25
replace i
if(s==1) s=2;
with
if(s<=1) s=2;

By the way seiving for every test case makes it slower though it passed but have a look at my code too.
It sieves only once.
https://ide.codingblocks.com/#/s/28787