What is wrong in my code?

Here is my code for Pythagorean triplets:

#include
using namespace std;

int main() {
int num;
cin>>num;
if (num%2 == 0) {
int n = num/2;
int m = 1;
int p = nn - 1;
int h = n
n + 1;
if (p>0) {
cout<<p<<" “<<h<<endl;
}
else {
cout<<”-1";
}
}
else {
int m = (num+1)/2;
int n = (num-1)/2;
int p = 2mn;
int h = nn + mm;
if (p>0) {
cout<<p<<" “<<h<<endl;
}
else {
cout<<”-1";
}
}
return 0;
}

2 test cases are wrong. Please tell me what am i doing wrong?

Hey @HemantKumar when num is odd the solution is ((numnum) - 1)/4 and ((numnum) + 1)/4 please correct that compile your code again.