#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ll t, r1, c1, r2, c2, i = 1;
cin >> t;
while(t--)
{
cin >> r1 >> c1 >> r2 >> c2;
ll r = abs(r1-r2);
ll c = abs(c1-c2);
if(r == c)
{
cout << "Case " << i++ << ": " << 1 << "\n";
}
else if(r%2 == c%2)
{
cout << "Case " << i++ << ": " << 2 << "\n";
}
else
{
cout << "Case " << i++ << ": " << "impossible" << "\n";
}
}
return 0;
}
#define ll long long int
using namespace std;
int main()
{
ll t, r1, c1, r2, c2, i = 1;
cin >> t;
while(t--)
{
cin >> r1 >> c1 >> r2 >> c2;
ll r = abs(r1-r2);
ll c = abs(c1-c2);
if(r == c)
{
cout << "Case " << i++ << ": " << 1 << "\n";
}
else if(r%2 == c%2)
{
cout << "Case " << i++ << ": " << 2 << "\n";
}
else
{
cout << "Case " << i++ << ": " << "impossible" << "\n";
}
}
return 0;
}
Comments
Post a Comment