Eigenspace of a matrix
Work in \(\mathbb F_p\), where \(p=1\,000\,000\,007\). Given a square matrix
\(A\) and a scalar \(\lambda\), find a basis of the eigenspace
\[
E_\lambda=\{v:(A-\lambda I)v=0\}.
\]
Input
The first line contains (n) and \(\lambda\). The next (n) lines contain
the (n\times n) matrix (A).
Output
Print the dimension (k), followed by (k) vectors of length (n). They must
be linearly independent and span (E_\lambda). If \(\lambda\) is not an
eigenvalue, print (0) and no vectors.
Constraints
- \(1\le n\le 100\)
- Every matrix entry and \(\lambda\) is an integer in \([0,p)\)