/*
TTTTTTTTT h h eeeeeeeee BBBBBBBBB aaaa dddddddd rrrrrrrr iiiiiiii X X
T h h e B B a a d d r r ii X X
T h h e B B a a d d r r ii X X
T hhhhhhhhh eeeeeeeee BBBBBBBBB aaaaaaaaaa d d rrrrrrrrr ii X
T h h e B B a a d d rr rr ii X X
T h h e B B a a d d rr rr ii X X
T h h eeeeeeeee BBBBBBBBB a a dddddddd rr rr iiiiiiii X X
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
/*
- Give yourself 40 Minutes **of being stuck** before reading editorial
- if you need the editorial, read it bit-by-bit and process it
- code the solution once you understand it
- Note down what are you doing/thinking of as you do it
*/
int main()
{
ios_base::sync_with_stdio(false);cin.tie(nullptr);
int tt;cin>>tt;
while(tt--)
{
int x1=-10000,y1=-10000,x2=10000,y2=10000;
int n;cin>>n;
while(n--)
{
int a,b,c,d;cin>>a>>b>>c>>d;
x1=max(x1,a);
y1=max(y1,b);
x2=min(x2,c);
y2=min(y2,d);
}
ll ans=0;
if(x1<x2 && y1<y2) ans=(x2-x1)*(y2-y1);
cout<<"Case #1: "<<ans<<endl;
}
}
// "Failure is another stepping stone to greatness."
// It's fine to celebrate success, but it is more important to heed the lessons of failure.
//“Competition is the fuel that ignites innovation.”
LyoKVFRUVFRUVFRUICAgIGggICAgICAgaCAgICBlZWVlZWVlZWUgICAgQkJCQkJCQkJCICAgICAgICBhYWFhICAgICAgICAgZGRkZGRkZGQgICAgICBycnJycnJyciAgICAgaWlpaWlpaWkgICAgICBYICAgICAgIFgKICAgIFQgICAgICAgIGggICAgICAgaCAgICBlICAgICAgICAgICAgQiAgICAgICAgQiAgICAgIGEgICAgYSAgICAgICAgZCAgICAgICBkICAgICByICAgICAgIHIgICAgICAgaWkgICAgICAgICAgWCAgICAgWAogICAgVCAgICAgICAgaCAgICAgICBoICAgIGUgICAgICAgICAgICBCICAgICAgICBCICAgICBhICAgICAgYSAgICAgICBkICAgICAgICBkICAgIHIgICAgICAgciAgICAgICBpaSAgICAgICAgICAgWCAgIFgKICAgIFQgICAgICAgIGhoaGhoaGhoaCAgICBlZWVlZWVlZWUgICAgQkJCQkJCQkJCICAgICBhYWFhYWFhYWFhICAgICAgZCAgICAgICAgZCAgICBycnJycnJycnIgICAgICAgaWkgICAgICAgICAgICAgWAogICAgVCAgICAgICAgaCAgICAgICBoICAgIGUgICAgICAgICAgICBCICAgICAgICBCICAgYSAgICAgICAgICBhICAgICBkICAgICAgICBkICAgIHJyIHJyICAgICAgICAgICBpaSAgICAgICAgICAgWCAgWAogICAgVCAgICAgICAgaCAgICAgICBoICAgIGUgICAgICAgICAgICBCICAgICAgICBCICAgYSAgICAgICAgICBhICAgICBkICAgICAgIGQgICAgIHJyICAgcnIgICAgICAgICBpaSAgICAgICAgICBYICAgIFgKICAgIFQgICAgICAgIGggICAgICAgaCAgICBlZWVlZWVlZWUgICAgQkJCQkJCQkJCICAgIGEgICAgICAgICAgYSAgICAgZGRkZGRkZGQgICAgICByciAgICByciAgICAgaWlpaWlpaWkgICAgICBYICAgICAgWAouIC4gLiAuIC4gLiAuIC4gLiAuIC4gLiAuIC4gLiAuIC4gLiAuIC4gLiAuIC4gLiAuIC4gLiAuIC4gLiAuIC4gLiAuIC4gLiAuIC4gLiAuIC4gLiAuIC4gLiAuIC4gLiAuIC4gLiAuIC4gLiAuIC4gLiAuIC4gLgoqLwojaW5jbHVkZSA8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBsbCBsb25nIGxvbmcKI2RlZmluZSBsZCBsb25nIGRvdWJsZQovKgotIEdpdmUgeW91cnNlbGYgNDAgTWludXRlcyAqKm9mIGJlaW5nIHN0dWNrKiogYmVmb3JlIHJlYWRpbmcgZWRpdG9yaWFsCi0gaWYgeW91IG5lZWQgdGhlIGVkaXRvcmlhbCwgcmVhZCBpdCBi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