Code :- https://ide.codingblocks.com/s/233607
Evidently, squares of prime numbers are T-prime and hence I have used sieve for multiple test cases. But as sieve(vector) can be for max 10^9 size. Is there any other solution for values greater than 10^9 upto 10^12 ?