#Lutece3262. 模线性方程组
模线性方程组
Migrated from Lutece 3262 模线性方程组
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
注:本题不计一血。
已知 元线性一次方程组和素数。
$ \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}$
请根据输入的数据,编程输出在模素数p的条件下方程组的解的情况。
Input
第一行输入未知数的个数 和素数。
接下来 行,每行 个整数,表示每一个方程的系数及方程右边的在模p条件下的值。
Output
如果有唯一解,则输出解。 如果方程组无解输出 ; 如果有多解,输出 ;
Samples
3 7
2 -1 1 1
4 1 -1 5
1 1 1 0
x1=1
x2=0
x3=6
Constraints
对于 的数据,。 对于 ,有 ,,。
Resources
2024 UESTC ICPC Training for Math