D :: Largest Villa
Time Limit: 10 Seconds Memory Limit: 131072 KB
Having a grid based map, we would like to build a villa that its plan is in the shape of below or any rotation of it. (a three quarter of a square)
On the other hand, there are some trees on the map which we certainly don't want to cut down. Your task is to find the biggest area (which is like the shape above) that has no trees in it.
Input
The input consists of several test cases (at most 30 test cases). Each test case starts with 3 integers, M, N and T. The Airst two are the dimensions of the Aield, and the third integer is the number of the trees.
This line is followed by T lines, each having 2 integers, the coordinates of a tree (indexed from zero).
Caution: Huge input!
2 ≤ M,N ≤ 4000
T ≤ M.N/2 −1
Output
For each test case, output the maximum possible area for the desired villa.
Sample Input
15 14 5 10 0 11 2 7 3 11 6 14 11
Sample Output
147Submit
Source: 12th Iran Nationwide Internet Contest III