Hypotenuse
시간 제한1초메모리 제한2048 MB
직각삼각형의 두 변과 '?'가 주어질 때 빈 자리에 들어갈 변의 길이를 간단히 한 LaTeX 수식으로 구한다.
문제
Martijn is a math teacher and next weeks class is about geometry. He would like to have some tools for his pupils to practice the course material. One of his ideas is to have a program that can solve calculate the unknown length of one side of a right angled triangle, given the other two sides. Pythagorean theorem states that, in a right angled triangle, the square of the hypotenuse is equal to sum of the squares of the other two sides. Your task is to make a solver that uses Pythagorean theorem.
\begin{align*} &\text{AB}^2 + \text{AC}^2 = \text{BC}^2\\ \\ &a^2 + b^2 = c^2 \end{align*}

입력
The input consists out of two integers () and a question mark ('?'), in any order. The order of the three parts of the input match with , and .
출력
The solution to '?' in its most simple form and in LaTeX notation. For example: needs to be simplified to . The formula is in LaTeX written as "2 \cdot \sqrt{5}".