#P3389. Solving a Linear Equation System

    ID: 16646 Type: Default 1000ms 256MiB

Solving a Linear Equation System

Solving a Linear Equation System

Given a system of linear equations, find the values of (x_1, x_2, \dots, x_n).

The system can be represented in ( \LaTeX ) as follows:
$$ \begin{cases} a_{1,1}x_1 + a_{1,2}x_2 + \cdots + a_{1,n}x_n = b_1 \ a_{2,1}x_1 + a_{2,2}x_2 + \cdots + a_{2,n}x_n = b_2 \ \vdots \ a_{n,1}x_1 + a_{n,2}x_2 + \cdots + a_{n,n}x_n = b_n \end{cases} $$

It is guaranteed that the linear system has a unique solution.

inputFormat

The first line contains a single integer (n) representing the number of variables and equations. Each of the following (n) lines contains (n+1) space-separated numbers representing the coefficients (a_{i,1}, a_{i,2}, \dots, a_{i,n}) and the constant term (b_i) of the (i^{th}) equation.

outputFormat

Output the unique solution of the system as (n) numbers in a single line separated by a space. If a computed solution is an integer, output it without a decimal point.

sample

2
1 1 3
2 -1 0
1 2