P21565 [HackerEarth] Find the largest basin size in a given matrix.
普及
题目描述

Find the largest basin size in a given matrix.
9 9 9 8 8 8
8 8 8 7 7 7
7 7 7 7 7 7
8 8 8 8 9 9
5 5 5 5 6 3
5 5 5 3 3 3
For the above example, the Bold values form the maximum size basin. Answer for above case is: 9

INPUT
First line of the input contains N( Number of rows ) and M( Number of columns) separated by a space.
The next N lines contain M space separated elements representing the array. See sample input output for more clarity

OUTPUT
Print the size of the maximum size basin.

SAMPLE INPUT
6 6
9 9 9 8 8 8
8 8 8 7 7 7
7 7 7 7 7 7
8 8 8 8 9 9
5 5 5 5 6 3
5 5 5 3 3 3

SAMPLE OUTPUT
9

输入格式

见题面

输出格式

见题面

样例输入
6 6 9 9 9 8 8 8 8 8 8 7 7 7 7 7 7 7 7 7 8 8 8 8 9 9 5 5 5 5 6 3 5 5 5 3 3 3
样例输出
9