Solve the Equation
Time Limit: 1 sec
The Problem
A computer programmer knows that what is prime number and how to calculate prime
number. A number will be considered as a prime number if it is not divisible by all number less than it without 1 and the number himself. Suppose 5, 7, 23, 29 are the prime numbers. In this problem you have to solve the equation below.
N = P2
In this equation P is a prime number and N is equal to the square of P. In this problem you
have to find P for given value of N.
The Input
There are several lines of input. Each line will contain a single positive integer N
(1<=N<=10^8). For this N you have to find the prime number P. The input will terminate by
a line containing 0. This line will not be processed.
The Output
For each line of input print the required prime number. If it is not possible to find a prime
number for the given N then print “Not Found” (Quote for clarification).
Sample Input
121
122
0
Sample Output
11
Not Found
[University Level]
Inter School & College Programming Contest (ISCPC) 2017
Problem Setter: Milton Deb