#include <iostream>
#include <cmath>
using namespace std;
int main(){
int T, N, lowerX, higherX, lowerY, higherY, test;
cin >> T;
for (int i = 1; i <= T; ++i)
{
cin >> N >> lowerX >> lowerY >> higherX >> higherY;
for (int j = 2; j <= N; ++j)
{
cin >> test;
if (test>lowerX)
{
lowerX = test;
}
cin >> test;
if (test>lowerY)
{
lowerY = test;
}
cin >> test;
if (test<higherX)
{
higherX = test;
}
cin >> test;
if (test<higherY)
{
higherY = test;
}
}
if (((higherX-lowerX)==0)&&((higherY-lowerY)==0))
{
cout << "Case #" << i << ": " << 1 << "\n";
} else if ((higherX-lowerX)==0)
{
cout << "Case #" << i << ": " << abs(higherY-lowerY) << "\n";
}else if ((higherY-lowerY)==0)
{
cout << "Case #" << i << ": " << abs(higherX-lowerX) << "\n";
} else {
cout << "Case #" << i << ": " << abs(higherX-lowerX)*abs(higherY-lowerY) << "\n";
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpewoJaW50IFQsIE4sIGxvd2VyWCwgaGlnaGVyWCwgbG93ZXJZLCBoaWdoZXJZLCB0ZXN0OwoJY2luID4+IFQ7CgoJZm9yIChpbnQgaSA9IDE7IGkgPD0gVDsgKytpKQoJewoJCWNpbiA+PiBOID4+IGxvd2VyWCA+PiBsb3dlclkgPj4gaGlnaGVyWCA+PiBoaWdoZXJZOwoKCQlmb3IgKGludCBqID0gMjsgaiA8PSBOOyArK2opCgkJewoJCQljaW4gPj4gdGVzdDsKCQkJaWYgKHRlc3Q+bG93ZXJYKQoJCQl7CgkJCQlsb3dlclggPSB0ZXN0OwoJCQl9CgkJCWNpbiA+PiB0ZXN0OwoJCQlpZiAodGVzdD5sb3dlclkpCgkJCXsKCQkJCWxvd2VyWSA9IHRlc3Q7CgkJCX0KCQkJY2luID4+IHRlc3Q7CgkJCWlmICh0ZXN0PGhpZ2hlclgpCgkJCXsKC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