Doubt in pythagoras triplet

Scanner scn=new Scanner(System.in);
int n=scn.nextInt();

	if (n%2==0) {
		int a=((n/2)*(n/2))-1;
		int b=((n/2)*(n/2))+1;
		if (b==Math.sqrt((a*a)+(n*n))) {
			System.out.print(a);
			System.out.print(" ");
			System.out.print(b);
			
		}
		
		
	}
	
	 else {
		 int a1=((n/2)*(n))-(1/2);
		 int b1=((n/2)*(n))+(1/2);
		 if (b1==Math.sqrt((a1*a1)+(n*n))) {
		 
		      System.out.print(a1);
		      System.out.print(" ");
		      System.out.print(b1);
		 }
		 else {
			 System.out.println("-1");
			 
		 }
		
	}
	what is wrong in this code????

@harsh.hj reviewing it! please copy your full code and paste it in coding blocks ide and submit the link here bro!

this is my full code

@harsh.hj bro take care of the precedance order in your code, if have corrected your code below now dry run it first!

import java.util.*;
class Main {

public static void main(String[] args) {
    // TODO Auto-generated method stub

    Scanner scn=new Scanner(System.in);
    long n=scn.nextInt();
	if (n == 1 || n == 2) {
        System.out.println(-1);
		return;
	}

if (n%2==0) {
	long a=(n*n) / 4 - 1;
	long b=(n*n) / 4 + 1;
	System.out.println(a + " " + b);
} else {
	 long a1=(n * n - 1)/2;
	 long b1=(n * n + 1)/2;
	 System.out.println(a1 + " " + b1);
	
}
}

}