MTRXMOD- can somebody please point out the mistake in my solution

link to my solution - https://ideone.com/scTMaE
problem link - https://www.codechef.com/problems/MTRXMOD