How to take a lng input in java

in this qestion ineed to take a long int as input how to do that

can you tell why my testcase 1 is not passing

import java.util.; public class Main { public static void main(String args[]) { Scanner sc=new Scanner(System.in); long n=sc.nextLong(); if(n<=2) System.out.print("-1"); else if(n%2==0){ long var=(n/2)(n/2); System.out.print(var-1+" “+ var+1); } else{ long var=n*n; System.out.print((var-1)/2+” "+ (var+1)/2); } } }

Hey @adarshsingh2k You code is failing for the test where n = 6; you Code is giving ans 8 91 but it has to be 8 10.

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.