#C6663. Find the Highest Peak

    ID: 50448 Type: Default 1000ms 256MiB

Find the Highest Peak

Find the Highest Peak

Given a terrain represented as a matrix with \(N\) rows and \(M\) columns, your task is to determine the location of the highest peak. Each element in the matrix corresponds to the height at that position.

If multiple cells share the maximum height, return the coordinates of the cell that appears first in row-major order (i.e. from top to bottom, left to right). The coordinates are \(0\)-indexed.

For example, in the matrix:

1 2 3
6 5 4
7 8 9

the highest peak is \(9\) at position \((2, 2)\).

Note: If any formulas are required, use \( \LaTeX \) format.

inputFormat

The first line contains two integers \(N\) and \(M\), representing the number of rows and columns in the matrix respectively.

This is followed by \(N\) lines, each containing \(M\) space-separated integers representing the heights of the terrain.

outputFormat

Output two integers separated by a space: the row and column indices of the highest peak.

## sample
3 3
1 2 3
6 5 4
7 8 9
2 2

</p>