Codeforces Round #623 (Div. 2) Dead Pixel

解題報告:

思路:四個可能的區域取個最大值就是答案。

代碼:

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ll a, b, x, y, t;
    scanf("%lld", &t);
    while(t--){
        scanf("%lld%lld%lld%lld", &a, &b, &x, &y);
        ll maxn = 0;++x;++y;
        maxn = max(maxn, (x-1)*b);
        maxn = max(maxn, (y-1)*a);
        maxn = max(maxn, (b-y)*a);
        maxn = max(maxn, (a-x)*b);
        printf("%lld\n", maxn);
    }
    return 0;
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章