TLE COMES IN FIRST CASE OF THIS PROGRAM

Scanner sc = new Scanner(System.in);
int n = 0;
if (sc.hasNext()) {
n = sc.nextInt();
}
int a=0;
int t=0;
int i = n+1;
while(i+(int)Math.pow((Math.pow(n, 2)+Math.pow(i, 2)),0.5)>n&&n+(int)Math.pow((Math.pow(n, 2)+Math.pow(i, 2)),0.5)>i&&n+i>(int)Math.pow((Math.pow(n, 2)+Math.pow(i, 2)),0.5)) {
t = (int)Math.pow((Math.pow(n, 2)+Math.pow(i, 2)),0.5);
if(Math.pow((Math.pow(n, 2)+Math.pow(i, 2)),0.5)==(double)t) {
a=i;
break;
}
i++;
}
if(a!=0) {
System.out.println(a+" “+t);
}else {
System.out.println(”-1");
}

Hey
Change data Type int to long
try for this input
99999993
correct output :
4999999300000024 4999999300000025