1 test case is not working. How to check if triplets doesn’t exist?
#include
#define ll long long
using namespace std;
int main() {
ll n;
cin>>n;
if(n<=0)
{ cout<<"-1";return 0;}
if(n%2==0)
{
ll temp1=((n/2)*(n/2))-1;
ll temp2=((n/2)*(n/2))+1;
cout<<temp1<<" "<<temp2<<"\n";
}
else
{
ll temp1=(n+1)*((n-1)/2);
ll temp2=((n+1)/2)*((n+1)/2);
ll temp3=((n-1)/2)*((n-1)/2);
cout<<temp1<<" "<<temp3+temp2<<"\n";
}
return 0;
}