Unable to find whats wrong in my code

Please explain whats wrong in my code

Hey @piyushabhiranjan30
if they exist. Otherwise, print “-1”.
and Change data Type
long n=sc.nextLong();
instead of int n=sc.nextInt();