#include
using namespace std;
int main() {
unsigned int N;
int m,n,a,b,c;
cin>>N;
if(N%2==0){
m = N/2;
n = 1;
a = (mm) - (nn);
b = 2mn;
c = (mm) + (nn);
cout<<a<<" “<<c;
}
else if(N%2!=0) {
m = (N+1)/2;
n = (N-1)/2;
a = (mm) - (nn);
b = 2mn;
c = (mm) + (nn);
cout<<b<<” “<<c;
}
else{
cout<<”-1"<<endl;
}
return 0;
}
Test case fail in Pythagoras Triplet problem
Hello @chitreshkumar.bsr this is the corrected code and it is passing every test case now.
Happy Learning!!
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.