
The given figure has titans at coordinates at (3,8) and (8,6) and (11,2). We can see that the maximum undefended rectangle is of area 12 units, therefore, the position shown in the picture has a penalty of 12.

The first line of input contains an integer ‘T’ denoting the number of test cases.
The first line of each test case contains three space-separated integers L, B, and N that are the length of the grid, breadth of the grid, and a number of beast titans, respectively.
The next N lines of each test case contain two space-separated integer numbers X and Y that represent the coordinates of the cell occupied by a titan.
For each test case, in a separate line, print a single integer which is the penalty of the given configuration.
You don’t have to print anything; it has already been taken care of. Just implement the given function.
1 <= T <= 5
1 <= L, B <= 3000
0 <= N <= MIN(L,B)
1 <= X <= L
1 <= Y <= B
Time Limit : 1 sec
The idea is to find the area of all possible rectangles formed by the configuration that is every rectangle formed between any four belts of titan reign(that titan can protect) and tore the maximum area out of all the rectangles.
The idea is to consider the maximum gap between the x coordinates as well as y coordinates and then finding the maximum area by multiplying these maximum gaps.