#include
using namespace std;
int main() {
int n,n1,n2;
cin>>n;
if(n%2==0)
{
n1=(n/2)(n/2)-1;
n2=(n/2)(n/2)+1;
cout<<n1<<" “<<n2;
}
else
{
n1=2*((n-1)/2)((n+1)/2);
n2=((n+1)/2)((n+1)/2)+((n-1)/2)*((n-1)/2);
cout<<n1<<” "<<n2;
}
return 0;
}
Why is the code not working:pyrthogorean triplet
please use long long instead of int and for n < 3 answer wont exist.
Corrected Code
oh snap didn’t notice that thanks