Using Krylov subspace and spectral methods for solving complementarity problems in many-body contact dynamics simulation