P27177 [AtCoder] Kusakabe
提高
题目描述

Problem Description

Kusakabe loves reflecting off walls, and today, she is playing by reflecting off the walls of a room with a right-angled triangular shape. Let's denote the vertices of the triangle as $A$, $B$, and $C$ as shown in the figure below. Kusakabe starts walking straight from vertex $C$ towards point $P$. Upon reaching point $P$, she walks straight again towards point $Q$ on side $AC$ such that angle $BPC$ = angle $APQ$.

ba130de932710340d919adab948af555.png

The length of segment $AB$ is $X$, the length of segment $BC$ is $Y$, and the length of segment $AQ$ is $Z$. What is the length of segment $AP$?

Input Format

The input is given from the standard input in the following format:

$ X $ $ Y $ $ Z $

Output Format

Output the length of segment $AP$. The answer will be considered correct if the absolute or relative error is at most $ 10^{-9} $.

Sample Input and Output

Sample Input #1

6 8 5

Sample Output #1

4

Sample Input #2

100 100 1

Sample Output #2

1.40428377656192537870

Notes/Hints

Constraints

  • $1 \leq X, Y \leq 100$
  • $1 \leq Z < \sqrt{X^2 + Y^2}$
  • $ X, Y, Z $ are integers
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
6 8 5
样例输出
4