Test 0 and Test 1 not passing

It shows run error. I have a seperate vector in which i put my prime no.s. What is the error?
link: https://ide.codingblocks.com/s/230358

since the 5000000th prime is large so in order to pass the test case the range of the vector for prime sieve needs to be large

refer to this code
do the calculation in int main to avoid segmentation fault