CodeChef April Challenge, Counting Matrices AC.