#c221301. 解方程组

解方程组

Solving a System of Linear Equations

Problem Description

You are given a system of linear equations with nn equations and nn unknowns. You need to find the value of each unknown.

If the system has no solution, output −1-1; if the system has infinitely many solutions, output −2-2.

The format of the system is as follows (in this problem m=nm = n):

b317c90eb8724966.png

Input Format

The first line contains a number nn, the number of unknowns and equations.

The next nn lines each contain n+1n+1 numbers; on the ii-th line, the jj-th (1≤j≤n1\leq j\leq n) number is the coefficient ai,ja_{i,j}, and the (n+1)(n+1)-th number is bib_i.

Output Format

If a normal solution exists, output nn lines each with one number representing the answer. As long as your answer and the standard answer have a relative or absolute error within 10−610^{-6}, it is accepted.

If not, output one line with −1-1 or −2-2, see the problem statement for details.

Sample Input 1

2
1.0 2.0 4.0
2.0 1.0 5.0

Sample Output 1

2.0000000000
1.0000000000

Sample Input 2

2
1.0 2.0 4.0
2.0 4.0 5.0

Sample Output 2

-1

Constraints

For 100%100\% of the data, $2\leq n\leq 100, 1\leq i, j\leq n, -10^8\leq a_{i,j}, b_i\leq 10^8$.