Basis of a row space
All arithmetic is performed in the finite field
You are given an \(n \times m\) matrix \(A\). The **row space** of \(A\) is the
set of all linear combinations of its rows over \(\mathbb{F}_p\).
Output any basis of this row space. The basis does not have to be unique, and
its vectors may be printed in any order.
Input
The first line contains two integers \(n\) and \(m\). The next \(n\) lines
contain the matrix \(A\), with \(m\) entries per line.
Output
Print an integer \(r\), the dimension of the row space. Then print \(r\) rows,
each containing \(m\) integers. These rows must be linearly independent and
must span exactly the same space as the rows of \(A\).
Every matrix entry is interpreted modulo \(p\); any integer representative is
accepted.