Advertisement
erfanul007

Light OJ 1202

Dec 31st, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. int main()
  4. {
  5. long long int t,i,x,y,x1,y1,x2,y2;
  6. scanf("%lld",&t);
  7. for(i=1;i<=t;i++){
  8. scanf("%lld %lld %lld %lld",&x1,&y1,&x2,&y2);
  9. printf("Case %lld: ",i);
  10. x=abs(x1-x2);
  11. y=abs(y1-y2);
  12. if(x==y)
  13. printf("1\n");
  14. else if(x%2==y%2)
  15. printf("2\n");
  16. else
  17. printf("impossible\n");
  18. }
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement