Codeforces Round #623 (Div. 2, based on VK Cup 2019-2020 - Elimination Round, Engine) A Dead Pixel
讨论坏点的左右上下的矩形大小。
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
long long a, b, x, y;
cin >> a >> b >> x >> y;
// cout<<a<<" "<<b<<" "<<x<<" "<<y<<endl;
long long ans = 0;
ans = max(ans, x * b);
ans = max(ans, a * y);
ans = max(ans, a * ( b-y-1));
// cout<<x * ( b-y)<<endl;
ans = max(ans, (a-x-1) *b);
cout<<ans<<endl;
}
}