Pythagorus Triplet- Java // Test case 4 and 5 not passed

import java.util.Scanner;

public class Pythagorus_Triplet {

public static void main(String[] args) {
	// TODO Auto-generated method stub
	Scanner scn = new Scanner(System.in);
	int n = scn.nextInt();
	if(n%2!=0) {         
		int base = (int) Math.pow(n, 2);  
		
		int rem1 = base/2;  
		
		int per = (int) Math.pow(rem1, 2);
		
		int rem = base-rem1;  
		
		int hypo= (int) Math.pow(rem, 2);
		
		if(hypo == (base)+(per) && n<rem1 && n<rem ){
		System.out.print(rem1+" ");
		System.out.print(rem);
		}
		else {
			System.out.print("-1");
		}
	}else {
		int base= (int) Math.pow(n,2);
		int rem= n/2;
		int sol= rem*rem;
		int per= (int) Math.pow(sol-1, 2);
		int hypo= (int) Math.pow(sol+1, 2);
		if(hypo == (base)+(per) && n<(sol-1) && n<(sol+1)){
			System.out.print(sol-1+" ");
			System.out.print(sol+1);
			}
		else {
			System.out.print("-1");
		}
		
	}
}

}