Pythagorous triplet

1 test case is not satisfying.

code below:

#include
using namespace std;
int main() {
long num;
cin>>num;
if(num>0)
{
if(num%2==0)
{

    long m,n,a,b;
    m=num/2;
    n=1;
    if(num==2*m*n)
    {
     a=m*m-n*n;
    b=m*m+n*n;
    cout<<a<<" "<<b;
    }
    else
    {
    cout<<"-1";
    }
    
}
else 
{
    long m,n,a,b;
    
    m=(num+1)/2;
    n=(num-1)/2;
    if(num==(m*m)-(n*n))
    {
     a=2*m*n;
     b=(m*m)+(n*n);
    cout<<a<<" "<<b;
    }
     else
     {
    cout<<"-1";
        }
}

}
else
{
cout<<"-1";
}
}

@Ayush-Saxena-1385006854975080 hey ayush you code is giving output 0 1 for input 1 but it should be -1 so put a condition when n==1 output should be -1

I had put the else block at the end then also i need to put n==1

@Ayush-Saxena-1385006854975080 COPY YOUR CODE ON IDE THEN SHARE IT HERE. SO I HELP YOU OUT