D. Nash Matrix time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Nash designed an interesting yet simple board game where a player is simply required to follow instructions written on the cell w…