Query over Matrix | CodeChef