#P2455. [SDOI2006] 线性方程组

    ID: 1461 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 难度: 7 上传者: 标签>2006各省省选山东素数判断,质数,筛法最大公约数,gcd排列组合高斯消元

[SDOI2006] 线性方程组

Description

Given an nn-variable linear system of equations:

$$\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 \\ \cdots \\ a_{n,1} x_1 + a_{n, 2} x_2 + \cdots + a_{n, n} x_n = b_n \end{cases}$$

Based on the input, write a program to output the status of the solution set.

Input Format

The first line contains the number of unknowns nn.
Then nn lines follow, each containing n+1n + 1 integers, representing the coefficients of each equation and the value on the right-hand side.

Output Format

If there is a unique solution, output the solution. Your result is considered correct if and only if, for every xix_i, the absolute error or the relative error compared to the standard answer does not exceed 0.010.01.

If the system has no solution, output 1-1;
if it has infinitely many real solutions, output 00.

3
2 -1 1 1
4 1 -1 5
1 1 1 0
x1=1.00
x2=0.00
x3=-1.00

Hint

Constraints
For 100%100\% of the testdata, 1n501 \le n \le 50. For all 1i,jn1 \le i, j \le n, ai,j100\left| a_{i, j} \right| \le 100, bi300\left| b_i \right| \le 300.

Translated by ChatGPT 5