P22328 [HackerRank] Pythagorean triple
普及-
题目描述

A Pythagorean triple consists of three positive integers $\boldsymbol{a}$, $\boldsymbol{b}$, and $\textbf{c}$, such that $a^2+b^2=c^2$. Such a triple is commonly written as $(a,b,c)$. This term comes from the Pythagorean theorem, which says that a Pythagorean Triple will be the lengths of the sides of a right-angled triangle.

You have been given an integer $\boldsymbol{a}$ which represents the length of one of cathetus of a right-angle triangle.

You need to find the lengths of the remaining sides. There may be multiple possible answers; any one will be accepted.

Hints:

Every odd number $2k+1$ can be represented as $(k+1)^2-k^2$.
If $m$ and $n$ are integers and $m>n$, then $(m^2-n^2)^2+(2mn)^2=(m^2+n^2)^2$.

Input Format

The first line contains an integer $\boldsymbol{a}$ denoting the length of one of cathetus of the right-angled triangle.

Constraints

$5\leq a<10^9$

Output Format

A single line containing the possible values of $\boldsymbol{a}$, $\boldsymbol{b}$ and $\textbf{c}$. You may print them in any order.

Sample Input 0
5

Sample Output 0
5 12 13

Explanation 0

We can see that the triple $(5,12,13)$ is a pythagorean triple:

$5^2+12^2=13^2$

输入格式

见题面

输出格式

见题面

样例输入
5
样例输出
5 12 13