#include
#include<math.h>
using namespace std;
int main()
{
int n;
cin>>n;
float h,b;
if(n%2==0)
{
h=pow((n/2),2)+1;
b=pow((n/2),2)-1;
if(h==int(h) && b==int(b))
{
cout<<b<<endl;
cout<<h<<endl;
}
else
{
cout<<"-1"<<endl;
}
}
else if(n%2!=0)
{
h=(pow(n,2)+1)/2;
b=(pow(n,2)-1)/2;
if(h==int(h) && b==int(b))
{
cout<<b<<endl;
cout<<h<<endl;
}
else
{
cout<<"-1"<<endl;
}
}
return 0;
}
What is the problem in this code?
