CF1315A.Dead Pixel
入门
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Screen resolution of Polycarp's monitor is a×b pixels. Unfortunately, there is one dead pixel at his screen. It has coordinates (x,y) (0≤x<a,0≤y<b). You can consider columns of pixels to be numbered from 0 to a−1, and rows — from 0 to b−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.
Polycarp 的显示器分辨率为 a×b 像素。不幸的是,屏幕上存在一个坏点(死像素),其坐标为 (x,y)(其中 0≤x<a,0≤y<b)。你可以认为像素的列编号从 0 到 a−1,行编号从 0 到 b−1。
Polycarp 想要打开一个面积最大的矩形窗口,且该窗口不能包含这个坏点。窗口的边界必须与屏幕的边平行。
请输出不包含坏点在内的窗口所能达到的最大面积(以像素为单位)。
输入格式
In the first line you are given an integer t (1≤t≤104) — the number of test cases in the test. In the next lines you are given descriptions of t test cases.
Each test case contains a single line which consists of 4 integers a,b,x and y (1≤a,b≤104; 0≤x<a; 0≤y<b) — the resolution of the screen and the coordinates of a dead pixel. It is guaranteed that a+b>2 (e.g. a=b=1 is impossible).
第一行给出一个整数 t(1≤t≤104),表示测试用例的数量。接下来的若干行给出 t 个测试用例的描述。
每个测试用例包含一行,该行包含 4 个整数 a,b,x 和 y(1≤a,b≤104;0≤x<a;0≤y<b),分别表示屏幕的分辨率以及坏点的坐标。保证 a+b>2(例如,a=b=1 的情况不可能出现)。
输出格式
Print t 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.
输出 t 个整数——每个测试用例的答案。每个答案应为一个整数,表示不包含坏点(dead pixel)的矩形窗口所能达到的最大面积(以像素为单位)。
输入输出样例
输入#1
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
输出#1
56 6 442 1 45 80
说明/提示
In the first test case, the screen resolution is 8×8, and the upper left pixel is a dead pixel. Here you can see one of two possible layouts of the maximal window.

在第一个测试用例中,屏幕分辨率为 8×8,左上角像素为坏点。以下是最大窗口的两种可能布局之一:

输入解题思路,AI测评打分。不知道怎么写?