[Python] 백준 1977번 : 완전제곱수

2021. 5. 4. 23:31

 


 

m = int(input())
n = int(input())

square = []
i = 1

while i**2 <= n:
  if m <= i**2 <= n:
    square.append(i**2)
  i+=1
  
if square == []:
  print(-1)

else:
  print(sum(square))
  print(square[0])

 


BELATED ARTICLES

more