707C. Pythagorean Triples

Problem Link

<Source Code>

#include<stdio.h>
int main()
{
long long int n,d,a,b;
scanf("%lld",&n);

if(n<=2)
{
printf("-1\n");
return 0;}

else
{n=n*n;
if(n%2)
    printf("%lld %lld\n",(n/2),(n/2)+1);
else
    printf("%lld %lld\n",(n/4)-1,(n/4)+1);
}


}

 

 

Advertisements

About waprogramming

I am in CSE,from CUET
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s