~/algor $ cat problems/begin-ichki-va-tashqi-aylana
Inscribed and circumscribed circles
Medium
1000 ms
64 MB
37%
The sides of a triangle $a$, $b$ and $c$ are given. Find the radius $r$ of its inscribed circle and the radius $R$ of its circumscribed circle; $p$ is the semi-perimeter, $S$ is the area:
$$p = \frac{a + b + c}{2}, \qquad S = \sqrt{p * (p - a) * (p - b) * (p - c)}, \qquad r = \frac{S}{p}, \qquad R = \frac{a * b * c}{4 * S}$$
Input
One line with three positive integers: $a$, $b$ and $c$.
Output
One line with two numbers: $r$ and $R$, each with exactly 3 digits after the decimal point (for example, 1.000).
Note
$1 \le a, b, c \le 1000$
Such a triangle exists: the sum of any two sides is greater than the third.
Examples
Input #1
3 4 5
Output #1
1.000 2.500
Input #2
2 2 2
Output #2
0.577 1.155