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

~/algor $ cat problems/uchburchak-medianalari

Medians of a triangle

Medium 1000 ms 64 MB 35%
Share

The sides of a triangle $a$, $b$ and $c$ are given. Find the medians $m_{a}$, $m_{b}$ and $m_{c}$ drawn to these sides. A median is a segment joining a vertex of the triangle with the midpoint of the opposite side:

$$m_{a} = \frac{\sqrt{2 * b^{2} + 2 * c^{2} - a^{2}}}{2}, \qquad m_{b} = \frac{\sqrt{2 * a^{2} + 2 * c^{2} - b^{2}}}{2}, \qquad m_{c} = \frac{\sqrt{2 * a^{2} + 2 * b^{2} - c^{2}}}{2}$$

A triangle with sides a, b and c; the midpoint of side a is joined to the opposite vertex — the median m_a

Input

One line with three positive integers: $a$, $b$ and $c$.

Output

One line with three numbers: $m_{a}$, $m_{b}$ and $m_{c}$, each with exactly 2 digits after the decimal point (for example, 4.27).

Note

$1 \le a, b, c \le 10^{4}$
Such a triangle exists: the sum of any two sides is greater than the third.

Examples

Input #1
3 4 5
Output #1
4.27 3.61 2.50
Input #2
6 6 6
Output #2
5.20 5.20 5.20

Sign in to submit a solution

Signing up is free and takes a minute.