No.419 Right Triangle
問題文最終更新日: 2026-06-28 07:17:19
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
yukicoder contest 148
(順位表)
の他の問題:
Problem Statement
You will make a right triangle using $3$ sticks of positive length.
The lengths of $2$ of the sticks are known, so find the length of the remaining $1$ stick.
Since you want the stick used to be as short as possible, find the minimum such length.
Input
a b
The lengths of the $2$ sticks are given on $1$ line, separated by a space.
All inputs are integers.
$1 \le a,b \le 1000$
Output
Output the minimum length of the remaining $1$ stick needed to make a right triangle.
Your answer is considered correct if its absolute error or relative error is at most $10^{-6}$.
Sample
Sample 1
Input
4 5
Output
3.0000000000
Sample 2
Input
5 3
Output
4.0000000000
Sample 3
Input
3 4
Output
2.6457513111
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
はむこ