Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/boolean-otkir-burchakli-uchburchak

Is it an acute triangle?

Medium 1000 ms 64 MB 40%
Share

The sides of a triangle $a$, $b$ and $c$ are given (in any order). Check whether the statement is true: “all angles of the triangle are acute”. If $c$ is the longest side, the triangle is acute when $c^{2} \lt a^{2} + b^{2}$, right when $c^{2} = a^{2} + b^{2}$ and obtuse when $c^{2} \gt a^{2} + b^{2}$.

An acute triangle with sides a, b and c

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}$
A triangle can be built from these sides: $a + b \gt c$, $a + c \gt b$, $b + c \gt a$.

Examples

Input #1
4 5 6
Output #1
1
Input #2
3 4 5
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.