Maximum Value
InterviewTime limit1sMemory limit128 MB
Given a 9x9 grid of numbers, find the maximum value and print its row and column position.
- Level
Easy2 of 10
- Topics
- Array, Implementation
- Solved
- No attempts yet
Problem
You are given 81 numbers written in a 9 by 9 grid. Each number is either a natural number or 0. Find the largest number, then determine the row and column where that number is located. Row and column numbers start from 1.
Input
Nine lines are given. Each line contains nine integers separated by spaces. Every number is at least 0 and less than 100.
Output
Print the largest number on the first line. On the second line, print the row number and column number of that value, separated by a space. If the largest number appears in more than one cell, you may print any one of its positions.