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

Most of us were introduced with Pythagoras’s theorem back at the high school. It states a simple yet fascinating fact about right triangles. A right triangle is a triangle, in which one of the angles is 90 degrees. Pythagoras’s theorem says, for right triangle, the following formula holds:

Here, c is the length of the hypotenuse and a and b are the length of the other two sides. If a, b and c are all integers, then together they are called a Pythagorean triple.

In this problem, you will be given a Pythagorean triple, you will have to answer the length of the hypotenuse from the given triple.

Input

The only input line contains three integers X, Y and Z ( 1 ≤ X,Y,Z ≤ 109 ), the three sides of a Pythagorean triangle.

Output

The output contains one integer, the length of the hypotenuse of the given triangle.

Samples

InputOutput
3 4 5
5
InputOutput
5 12 13
13


Discussion
Statistics

91% Solution Ratio

fsshakkhorEarliest, Dec '16

Mr.adnanFastest, 0.0s

nishat19Lightest, 0 B

touhidurShortest, 36B

Submit

Login to submit