https://www.acmicpc.net/problem/1977
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner s=new Scanner(System.in);
int m=s.nextInt();
int n=s.nextInt();
int min=n;
int num=0;
for(int i=1;;i++){
if(i*i>=m && i*i<=n){
num+=i*i;
if(i*i<=min) min=i*i;
}
if(i*i>n) break;
}
if(num==0) System.out.println("-1");
else{
System.out.println(num);
System.out.println(min);
}
}
}