Andrey Kim's submission of Matrix | CodeChef