Boolean
Boolean-31
Boolean-32
Boolean-33
~/algor $ cat problems/boolean-togri-burchakli-uchburchak
Is it a right triangle?
Easy
1000 ms
64 MB
20%
The lengths of three segments $a$, $b$ and $c$ are given (in any order). Check whether the statement is true: “a right triangle can be built from these segments”. By the Pythagorean theorem, for that the sum of the squares of the two shorter sides must equal the square of the longest side:
$$a^{2} + b^{2} = c^{2} \quad \text{or} \quad a^{2} + c^{2} = b^{2} \quad \text{or} \quad b^{2} + c^{2} = a^{2}$$
Input
One line with three positive integers: $a$, $b$ and $c$.
Output
One integer: $1$ if the statement is true, otherwise $0$.
Note
$1 \le a, b, c \le 10^{4}$
Examples
Input #1
3 4 5
Output #1
1
Input #2
2 3 4
Output #2
0