Wrong ans ,,,, TLE

Getting tle in test case (3,4)
wrong answer in test 5

actually you are doing unnecessary things, you just have to check that if the given number is a square of a prime or not.