Code Editor Not Working

Have written the code but the code editor is not compiling and editing it

import java.util.*;
import java.util.Scanner;
public class Main {

public static void main(String[] args) {
	
	
Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		
int sq = n*n;

if(sq%2 == 0)
{
	System.out.print("-1");
}

else
{
	int num = sq/2;
	
	System.out.print(num + " ");
	System.out.print(num+1);

}

}
}

hey @nikhilkapoor1999 The compiler is compiling the code successfully however your logic is wrong for this question that’s why you will be getting wrong answer. Try to change the approach.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.