Wall Builder I
题号:NC239617
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
Special Judge, 64bit IO Format: %lld

题目描述

See Problem N for PDF statements.
As a wealthy man, NIO buys an empty house that can be viewed as a rectangle of length a and width b. As the builder employed by NIO, you need to divide the space of his house into several rooms.

NIO selects n points on the four borders of the house, and you should build the walls according to the following steps:
  1. Select a point on the border that has not been selected.
  2. Start building a wall vertical to the border from this point.
  3. Stop building when it meets the wall that has been built or another border of the house.
  4. End if all the points have been selected. Otherwise, go back to step 1.
After that, the space of the house will be divided into several rooms, the largest of which will serve as the living room. NIO wants his living room to be as large as possible. As you can decide the order of selection of the points, please tell him the maximum area of the living room. The thickness of the walls is negligible.

输入描述:

The first line contains an integer T (), indicating the number of test cases.

The first line of each test case contains three integers n,a,b (, ), indicating the number of points on the border, the length of the house and the width of the house.

Each of the following n lines contains two integers x,y (, ), indicating the coordinate of the point. You can consider the house as a rectangle on the Cartesian coordinate system whose edges are parallel to the x or y axis, with one vertex at (0,0) and another at (a,b). For a point (x,y) on the border, it is guaranteed that one of the following conditions is met:

- ,
- ,
- ,
- ,

For any two different points (x_i,y_i) and (x_j,y_j), it is also guaranteed that:

- .
- if , then .
- if , then .

It is guaranteed that the sum of n over all test cases won't exceed .

输出描述:

For each test case, output one integer indicating the maximum area of the living room in a single line.
示例1

输入

复制
2
4 4 4
0 1
1 0
4 3
3 4
4 4 4
0 1
0 3
1 0
3 0

输出

复制
9
8

说明

A possible solution for the first test case in the sample:

A possible solution for the second test case in the sample: