#include<iostream>
#include<cmath>
using namespace std;
int T;
int main(){
cin >> T;
while(T--) {
int a, b, c, d;
cin >> a >> b >> c >> d;
cout << abs(a * b - c * d) << endl;
}
return 0;
}
//presented by 大吉大利,今晚AC