Missing cases in pythagorean triplet problem

This is my code for the pythagorean triplets problem.It isnt clearing test cases 4 and 5 of the problem and im unable to find where i went wrong.

include
using namespace std;
int main() {
int n,test;
int m;
cin>>n; //Input
if (n%2 ==0 && n>2)
{
m = n/2;
cout<<mm - 1<<" "<<mm + 1;
}
else if(n == 2 || n==1)
{
cout<<-1<<endl;
}
else
{ int a,b;
a = (n+1)/2;
b = (n-1)/2;

 cout << 2*a*b << ' '<< a*a + b*b;

}
return 0;

}
P.S : I wasnt able to copy the link from coding blocks ide.

hey @rohit_1202
N can be 10^9
so n^2 will overflow with integer
so use long long

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.