Given $N \times M$ matrix $A$, a size $N$ vector $b$. Please calculate a (size $M$) vector $x$ s.t. $Ax = b$. We consider everything $\mathbb{F}_ {998244353}$.
$N$ $M$
$A_ {0,0}$ $A_ {0,1}$ ... $A_ {0,M-1}$
$A_ {1,0}$ $A_ {1,1}$ ... $A_ {1,M-1}$
:
$A_ {N-1,0}$ $A_ {N-1,1}$ ... $A_ {N-1,M-1}$
$b_ 0$ $b_ 1$ ... $b_ {N-1}$
If there is no solution, print
-1
and if exists, print as follows.
$R$
$c_ 0$ $c_ 1$ ... $c_ {M-1}$
$d_ {0,0}$ $d_ {0,1}$ ... $d_ {0,M-1}$
:
$d_ {R-1,0}$ $d_ {R-1,1}$ ... $d_ {R-1,M-1}$
We note that $R$ is the rank of solution. $c_ i$ is one of the solution. For each $j$, $d_ {j,0}, ..., d_ {j,M-1}$ is the basis of solution.
2 3 1 2 3 4 5 6 50 122
1 998244351 26 0 1 998244351 1
No. | Testdata Range | Score |
---|