CF1315A.Dead Pixel

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Dead Pixel

Screen resolution of Polycarp's monitor is a×ba \times b pixels. Unfortunately, there is one dead pixel at his screen. It has coordinates (x,y)(x, y) (0x<a,0y<b0 \le x \lt a, 0 \le y \lt b). You can consider columns of pixels to be numbered from 00 to a1a-1, and rows — from 00 to b1b-1.

Polycarp wants to open a rectangular window of maximal size, which doesn't contain the dead pixel. The boundaries of the window should be parallel to the sides of the screen.

Print the maximal area (in pixels) of a window that doesn't contain the dead pixel inside itself.

Input

In the first line you are given an integer tt (1t1041 \le t \le 10^4) — the number of test cases in the test. In the next lines you are given descriptions of tt test cases.

Each test case contains a single line which consists of 44 integers a,b,xa, b, x and yy (1a,b1041 \le a, b \le 10^4; 0x<a0 \le x \lt a; 0y<b0 \le y \lt b) — the resolution of the screen and the coordinates of a dead pixel. It is guaranteed that a+b>2a+b \gt 2 (e.g. a=b=1a=b=1 is impossible).

Output

Print tt integers — the answers for each test case. Each answer should contain an integer equal to the maximal possible area (in pixels) of a rectangular window, that doesn't contain the dead pixel.

Note

In the first test case, the screen resolution is 8×88 \times 8, and the upper left pixel is a dead pixel. Here you can see one of two possible layouts of the maximal window.

Samples

6
8 8 0 0
1 10 0 3
17 31 10 4
2 1 0 0
5 10 3 9
10 10 4 8
56
6
442
1
45
80

在线编程 IDE

建议全屏模式获得最佳体验