Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int i, t;
- long long r1, c1, r2, c2, sum1, sum2;
- scanf("%d", &t);
- for(i=0;i<t;i++)
- {
- scanf("%lld %lld %lld %lld", &r1, &c1, &r2, &c2);
- sum1=r1+c1;
- sum2=r2+c2;
- if((sum1%2==0&&sum2%2==0)||(sum1%2!=0&&sum2%2!=0))
- {
- if(sum1==sum2||(r1==c1&&r2==c2)||(r1==c1+2&&r2==c2+2)||(r1==c1+1&&r2==c2+1))
- printf("Case %d: 1\n", i+1);
- else
- printf("Case %d: 2\n", i+1);
- }
- else
- printf("Case %d: impossible\n", i+1);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement