My code
#include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int n,m;
cin>>n>>m;
int x,y;
cin>>x>>y;
int ans;
int a=min(x,(n+1-x));
int b=min(y,(m+1-y));
ans=max((n-a)*m,(m-b)*n);
cout<<ans<<endl;
}
return 0;
}
Problem Link: FIZZBUZZ2306 Problem - CodeChef