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;
    }
}
posted @ 2020-02-24 03:07  风骨散人  阅读(100)  评论(0编辑  收藏  举报