B. Fortress
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

There is a a grid with n rows and m columns, in which there are k monsters.

The i th monster lives in (x_i, y_i) (the x_i th row of the y_i th column).

Now we need to build a fortress. The fortress is a rectangular area, with the upper left corner in (r_1, c_1) and the lower right corner in (r_2, c_2).

All the rows between r_1 and r_2 and the columns between c_1 and c_2 belong to the fortress.

A valid fortress requires

After building the fortress, all monsters i satisfy or will be eliminated (i.e. the attack area of the fortress is a cross area)

Now it is required to eliminate all monsters and find the minimum area of the fortress, that is, minimize

输入描述:

The first line contains 3 intergers 
- the number of rows, columns and mosters.

Each of the next k lines contains two intergers - the position of the i th monster.

输出描述:

For each test case, print a single integer, the minimum area.
示例1

输入

复制
4 4 8
1 2
1 3
2 1
2 4
3 1
3 4
4 2
4 3

输出

复制
4

说明

One of the optimal solutions of the sample test:r_1=2,r_2=3,c_1=2,c_2=3