勾股定理------:
当其中一个数a大于1并且为奇数时即a=2*n+1, 那么另外两个数分别为 b=2*n*n+2*n; c=b+1;
当a为大于等于4的偶数时,即a=2*n时,那么另外两个数分别为 b=n*n-1 c=n*n+1;
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll a; cin>>a; if(a>1 && a&1) { ll x=(a-1)/2; ll y=2*x*x+2*x; cout<<y<<" "<<y+1<<endl; } else if(a>=4 && a%2==0) { ll xx=a/2; ll yy=xx*xx+1; cout<<yy<<" "<<yy-2<<endl; } else cout<<-1<<endl; return 0; }