~/algor $ cat problems/begin-tenglamalar-sistemasi
System of equations
A system of two linear equations in two unknowns is given:
$$\begin{cases} a_{1} * x + b_{1} * y = c_{1} \\ a_{2} * x + b_{2} * y = c_{2} \end{cases}$$
The determinant $D = a_{1} * b_{2} - a_{2} * b_{1}$ is non-zero, so the solution is unique. Find $x$ and $y$ with Cramer's rule:
$$x = \frac{c_{1} * b_{2} - c_{2} * b_{1}}{D}, \qquad y = \frac{a_{1} * c_{2} - a_{2} * c_{1}}{D}$$
Input
The first line has three integers: $a_{1}$, $b_{1}$ and $c_{1}$. The second line has three integers: $a_{2}$, $b_{2}$ and $c_{2}$.
Output
One line with two numbers: $x$ and $y$, each with exactly 2 digits after the decimal point (for example, 2.00). If the rounded result is zero (for example, $-0.001$), print 0.00 (not -0.00).
Note
$-1000 \le a_{1}, b_{1}, c_{1}, a_{2}, b_{2}, c_{2} \le 1000$
$a_{1} * b_{2} - a_{2} * b_{1} \ne 0$
Examples
1 1 3 1 -1 1
2.00 1.00
2 3 7 4 -1 0
0.50 2.00