It works for negative numbers but only partial numbers

Code please include hash
include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
if(n==1 || n==2)
{
cout<<-1<<endl;
}
else if(n%2!=0 && n>0)
{
int c=nn+1;
int p1=(c/2)-1;
int p2=c/2;
cout<<p1<<" "<<p2<<endl;
}
else if(n%2==0 && n>0)
{
int c=n
n/4;
int p1=c-1;
int p2=c+1;
cout<<p1<<" “<<p2<<endl;
}
else if(n%2!=0 && n<0)
{
int c=nn+1;
int p1=(c/2)-1;
int p2=c/2;
cout<<-1
p1<<” "<<-1p2<<endl;
}
else if(n%2==0 && n<0)
{
int c=n
n/4;
int p1=c-1;
int p2=c+1;
cout<<-1p1<<" "<<-1p2<<endl;
}
else{
cout<<-1<<endl;
}
return 0;
}

Do these change in your cde,
Any number less then 3, will give output as -1 so no need to implement else if condition for n<0 remoe that ese if condition.
Secondly numbers are very high, so instead of int, declare all variables as long long it. You will pass all test cases.

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.