One wrong testcase

#include
typedef long long ll;
using namespace std;
int main() {
ll n;
cin>>n;

if(n%2==0){
	cout<<((n*n)/4)-1<<" "<<((n*n)/4)+1;
}
else{
	cout<<((n*n)-1)/2<<" "<<((n*n)+1)/2;
	//cout<<2*((n+1)/2)*((n-1)/2)<<" "<<((n+1)*(n+1))/4 + ((n-1)*(n-1))/4;
}
return 0;

}

try after adding this condition

if(n<3)
cout<<" -1" ;

still same, one test case doesn’t pass

you also have to use long long int
after that it will pass all testcases

Reference Code