Pythagoras Triplet

include
using namespace std;
int main() {
long long int n,N;
cin>>n;
if(n==1 || n==2 || n==-2 || n==-1 || n==0){
cout<<"-1"<<endl;
}
else if(n%2==0){
N=(nn)/4;
cout<<n<<endl<<N-1<<endl<<N+1;
}
else if(n%2!=0){
N=(n
n)+1;
cout<<n<<endl<<N/2 - 1<<endl<<N/2;
}
return 0;
}

This is my program which shows wrong output for all cases except test case 4. Please help to solve this challenge.

please share the code.

The approach you are using in your code is wrong… Use the following approach as,
if(no%2==0)
{
m = l/2;
n = 1;
a = (mm)-(nn);
b = l;
c = (mm)+(nn);
if(((aa)+(bb))==(cc))
{
cout<<a<<" "<<c;
}
}
else
{
m = (l+1)/2;
n = (l-1)/2;
a = l;
b = 2
mn;
c = (m
m)+(nn);
if(((a
a)+(bb))==(cc))
{
cout<<b<<" "<<c;
}
}

You need to use these formulaes for even and odd cases…Pls make these changes in your code…