Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clude<bits/stdc++.h>
- using namespace std;
- int main()
- {
- ios::sync_with_stdio(false);cin.tie(0);
- int t,c=0,v=1,v1=2;
- cin>>t;
- while(t--)
- {
- int x,y,x1,y1,ans,f,e;
- c++;
- cin>>x>>y>>x1>>y1;
- cout<<"Case "<<c<<": ";
- e=(x>=y)?(x-y):(y-x);f=(x1>=y1)?(x1-y1):(y1-x1);
- if((x+y)%2==0)
- {
- if((x1+y1)%2!=0) cout<<"impossible"<<endl;
- else if((x1+y1)%2==0 && e==f ) cout<<v<<endl;
- else cout<<v1<<endl;
- }
- else {
- if((x1+y1)%2==0) cout<<"impossible"<<endl;
- else if((x1+y1)%2!=0 && e==f) cout<<v<<endl;
- else cout<<v1<<endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement