Farmer Józef, a well-known farmer and breeder, is always looking for ways to grow his farm. This time he has decided to start raising kangaroos.
He prepared a meadow divided by a regular grid into unit fields of size 1×1. The meadow has W rows of K fields each, for a total of W×K fields.
Farmer Józef brought N kangaroos onto the meadow, and each one picked its own favorite field (every kangaroo a different field). He now wants to build the smallest possible enclosure that still contains the favorite fields of all the kangaroos.
The enclosure must satisfy:
Among all enclosures meeting these conditions, it must contain the fewest fields.
Write a program that computes the number of fields contained in the optimal enclosure.
The first line contains an integer Z (1≤Z≤10), the number of test sets. Then Z sets follow.
The first line of each set contains three space-separated integers W, K, N (1≤W,K≤106, 3≤N≤106): the meadow dimensions and the number of kangaroos.
Each of the next N lines contains two space-separated integers wi, ki (1≤wi≤W, 1≤ki≤K), where wi is the row and ki is the column of the i-th kangaroo's favorite field. All favorite fields are distinct.
Every test set describes a non-degenerate case: the polygon of the optimal enclosure has a nonzero area.
For each test set, print on its own line the number of fields contained in the optimal enclosure.


