A mining survey grid is R-by-C, each cell holding an integer ore-grade reading. A drill can move from a cell to any of its 4 edge-adjacent neighbors (up, down, left, right), but only if the neighbor's reading is strictly greater than the current cell's reading.
A drilling path is a sequence of cells where each step follows that rule; its length is the number of cells it visits (a single cell is a valid path of length 1). Find the length of the longest possible drilling path anywhere in the grid.
Input format
Line 1: two integers R and C.
Next R lines: each contains C space-separated integers, the ore-grade readings.
Output format
A single integer: the number of cells in the longest strictly increasing path.
Constraints
- 1 <= R, C <= 200
- -1000000000 <= each reading <= 1000000000