問題一覧 > 通常問題

No.419 Right Triangle

レベル : / 実行時間制限 : 1ケース 1.000秒 / メモリ制限 : 512 MB / 小数誤差許容問題 絶対誤差または相対誤差が $10^{-6}$ 以下。ただし、ジャッジ側の都合で500桁未満にしてください
タグ : (AC するまで非表示) / 解いたユーザー数 402
作問者 : kzyKT / テスター : はむこ
お気に入りにしたユーザー ProblemId : 615 / 自分の提出
問題文最終更新日: 2026-06-28 07:17:19
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もしくは右上の雲マークをクリックしてアカウントを作成してください。