Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- int color(ll a, ll b)
- {
- if(a%2==1)
- {
- if(b%2==1)return 1;
- else return 2;
- }
- else
- {
- if(b%2==1)return 2;
- else return 1;
- }
- }
- int main()
- {
- int t;
- cin>>t;
- for(int i=1;i<=t;i++)
- {
- ll a,b,c,d;
- bool f=true;
- cin>>a>>b>>c>>d;
- if(color(a,b)==color(c,d))
- {
- if(abs(a-c)==abs(b-d))printf("Case %d: 1\n",i);
- else printf("Case %d: 2\n",i);
- }
- else printf("Case %d: impossible\n",i);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement