66. Pythagoras (200 points)

Time Limit: 1 seconds

Memory Limit: 1024 MB

Rating: 900

Problem Statement

Given two integers $A$ and $B$ $(1 \le A, B \le 10^9)$, output the square root of the sum of its squares rounding down to a whole number. More formally, output the value of $\lfloor \sqrt {A^2+B^2} \rfloor$, where $\lfloor x \rfloor$ denotes $x$ rounded down to integer precision.

Input

The first line has integer $A$. The second line has integer $B$.

Output

Output the value of $(\lfloor \sqrt {A^2+B^2} \rfloor)$.

Sample Cases
Sample Input 1:
3
4

Sample Output 1:
5


Sample Input 2:
7
24

Sample Output 2:
25
Explanation

Not available for this problem.

Sources

IanOJ Contest #2 (Div. 4) > Problem E (Contributed by admin@ian@)

Submit | Back