Pythagoras Triplet Challenge

nclude
using namespace std;
int main() {
int N,n,m,a,b,c;
cin>>N;
if(N==1 || N==2 || N==-1|| N==-2 || N==0){
cout<<"-1"<<endl;
}
else if(N%2==0){
m=N/2;
n=1;
a=(mm)-(nn);
b=2mn;
c=(mm)+(nn);
if(((aa)+(bb))==(cc)){
cout<<a<<endl<<c;
}
}
else{
m=(N+1)/2;
n=(N-1)/2;
a=(m
m)-(nn);
b=2
mn;
c=(m
m)+(nn);
if(((a
a)+(bb))==(cc)){
cout<<b<<endl<<c;
}
}
return 0;
}

For this code also test case 0 and 1 shows wrong output.Please share the code for which all test cases show correct answer.

@naazsayma123 look at this code for help it works for all test cases (https://ide.codingblocks.com/s/199787).

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.