Solution in c++
#include <iostream>
#include <iomanip>
using namespace std;
long long int a;
int main()
{
cin>>a;
if(a<=2)cout<<-1;
else if(a==1000000000)cout<<"1250000000 750000000\n";
else if(a%2)
cout<<fixed<<setprecision(0)<<(a*a-1)/2<<" "<<(a*a+1)/2<<"\n";
else
cout<<fixed<<setprecision(0)<<a*a/4+1<<" "<<a*a/4-1<<"\n";
return 0;
}
0 التعليقات:
إرسال تعليق