Basis of a null space
All arithmetic is performed in
For an \(n \times m\) matrix \(A\), its **null space** is
Output any basis of \(\ker(A)\). The basis and its ordering are not unique.
Input
The first line contains \(n\) and \(m\). The next \(n\) lines contain the
matrix \(A\), with \(m\) entries per line.
Output
Print an integer \(k\), the dimension of the null space. Then print \(k\)
vectors, one per line, each with \(m\) entries. Every vector must satisfy
\(Ax=0\), and the vectors must be linearly independent and span all such
vectors.
The expected dimension is \(k=m-\operatorname{rank}(A)\). Entries are compared
modulo \(p\), so any integer representative is accepted.