#IOI20021A. The Troublesome Frog
The Troublesome Frog
Description
Format
Input
Your program is to read from standard input. The first line contains two integers R and C , respectively the number of rows and columns in your rice paddy,. The second line contains the single integer N, the number of flattened rice plants, . Each of the remaining N lines contains two integers, the row number () and the column number () of a flattened rice plant, separated by one blank. Each flattened plant is only listed once.
Output
Your program is to write to standard output. The output contains one line with a single integer, the number of plants flattened along a frog path which did the most damage if there exists at least one frog path, otherwise, 0.
Samples
Limitation
If your program outputs the correct answer for a test case within the time limit, then you get full points for the test case, and otherwise you get 0 points.