PTRI - primes triangle (I)
primes triangle is a triangle that contain all prime numbers .
7 11 13
17 19 23 29
you task is very easy given an integer from 1 to 10^8 prints its place in the primes triangle .
in the first line integer 1<= T <= 10^5 , followed by T lines each line contain integer 1 <= n <= 10^8 .
one line contain pair of integers i , j .where i is the row number and j is the column number , 1 base . or -1 if n not exist in the primes triangle .
Output: 2 1
if you find Time limit is small here you can solve the tutorial version here :
I know what means SIGSEGV. But I can get also SIGABRT, could you check that all input file is correct so 1<=n<=100000000 is valid and you give exactly T values? Though the single code that only check this doesn't give this error.