I am failing 2 out of 6 test cases. I don't know what's wrong. Please help

#include
using namespace std;

int main(){

int n,s1,s2,hyp;
cin>>n;

if((n==0)||(n==1)||(n==2)||(n<0))
    cout<<-1;

else{

if(n%2==0){

    s1=(n/2)*(n/2)-1;
    s2=n;
    hyp=(n/2)*(n/2)+1;
    
    if((hyp*hyp)==(s1*s1+s2*s2))
            cout<<s1<<" "<<hyp;
    else
            cout<<-1;
}

else{

    s1=(((n+1)/2)*((n+1)/2))-(((n-1)/2)*((n-1)/2));
    s2=2*((n+1)/2)*((n-1)/2);
    hyp=(((n+1)/2)*((n+1)/2))+(((n-1)/2)*((n-1)/2));
     if((hyp*hyp)==(s1*s1+s2*s2))
            cout<<s2<<" "<<hyp;
    else
            cout<<-1;

}

}

return 0;
}