Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/teng-yonli-uchburchak-elementlari

Parts of an isosceles right triangle

Medium 1000 ms 64 MB 43%
Share

One of the elements of an isosceles right triangle is given: $1$ — leg $a$, $2$ — hypotenuse $c$, $3$ — the height $h$ dropped to the hypotenuse, $4$ — area $S$. They are related by:

$$c = a * \sqrt{2}, \qquad h = \frac{c}{2}, \qquad S = \frac{a^{2}}{2}$$

The element number $N$ and its value $X$ are given. Find the other three elements.

The elements of an isosceles right triangle

Input

One line with an element number $N$ and its value $X$.

Output

One line with the other three elements in order of their numbers ($a$, $c$, $h$, $S$ without the given one), each with exactly 2 digits after the decimal point (for example, 1.41 0.71 0.50).

Note

$1 \le N \le 4$
$0 \lt X \le 100$, $X$ is an integer

Examples

Input #1
1 1
Output #1
1.41 0.71 0.50
Input #2
1 2
Output #2
2.83 1.41 2.00

Sign in to submit a solution

Signing up is free and takes a minute.