Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Pythagoras Rocks

Limits 1s, 512 MB

A Pythagorean triple consists of three positive integers aa, bb, and cc, such that a2+b2=c2a^2 + b^2 = c^2.

The Pythagoras's theorem says, for a right triangle (a triangle with one of the sides being 90°90\degree), the same formula holds (where aa, bb, and cc) are the three sides of the triangle.

In this problem, you will be given a Pythagorean triple, you will have to determine which of the three numbers in the triple represents the hypotenuse of the triangle.


The only input line contains three integers XX, YY, and ZZ (1X,Y,Z1091 \le X, Y, Z \le 10^9), the three sides of a Pythagorean triangle.


Print the number among XX, YY, and ZZ that represents the hypotenuse.


3 4 5
5 12 13


Toph uses cookies. By continuing you agree to our Cookie Policy.