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.