Hide

Problem B
Hornrétt

Languages en is
/problems/hornrett/file/statement/en/img-0001.jpg
Image from Flickr
Arnar is a poor student on his last year of studies. He’s doing his exams and only has one exam left, the mathematics exam. He’s asked whether a specific triangle has a right angle, but he can’t remember the formula to solve the problem. Usually this would be fine since one is allowed to bring a formula sheet to the exam, but Arnar was lazy and overconfident and thus didn’t prepare a formula sheet. Since he’s poor, he can’t afford to fail, he can’t afford another term of school. Can you save Arnar?

Input

The input contains three integers $a$, $b$, and $c$, the side lengths of the triangle.

Output

Print the area of the triangle if it’s possible to make a right angled triangle with side lengths $a$, $b$ and $c$, otherwise print $-1$.

Scoring

Group

Points

Constraints

1

50

$1 \leq a \leq b \leq c \leq 10^4$

2

50

$1 \leq a \leq b \leq c \leq 10^9$

Sample Input 1 Sample Output 1
3 4 5
6
Sample Input 2 Sample Output 2
4 6 7
-1

Please log in to submit a solution to this problem

Log in