Finding the matrix | CodeChef