Questions algorithm to train a large number of completely equal to the minimum square of n
Resource limitation
time limit: 1.0s memory limit: 256.0MB
problems described
a large output is equal to the smallest perfect square of n.
If the number can be expressed in the form of a square of a natural number, the called number is a perfect square
Tips: Note that the range of the data
input format of
an integer n
output format
large as the smallest perfect square of n
sample input
71711
Sample Output
71,824
data size conventions and
n is a 32-bit signed integer
while True:
try:
n = int(input())
if n<=0:
print(0)
break
else:
m = n**0.5
if int(m)*int(m) == n:
print(int(m)*int(m))
else:
print(int((m+1))*int((m+1)))
except:
break