~/algor $ cat problems/begin-kosinuslar-teoremasi
Law of cosines
Medium
1000 ms
64 MB
39%
Two sides of a triangle $a$, $b$ and the angle $\gamma$ between them (in degrees) are given. Find the third side $c$ and the area $S$ of the triangle:
$$c = \sqrt{a^{2} + b^{2} - 2 * a * b * \cos \gamma}, \qquad S = \frac{1}{2} * a * b * \sin \gamma$$
Use $\pi = 3.141592653589793$.
Input
One line with three positive integers: $a$, $b$ and $\gamma$.
Output
One line with two numbers: $c$ and $S$, each with exactly 2 digits after the decimal point (for example, 5.00).
Note
$1 \le a, b \le 1000$
$1 \le \gamma \le 179$
Examples
Input #1
3 4 90
Output #1
5.00 6.00
Input #2
5 5 60
Output #2
5.00 10.83