View the problem LightOJ 1202 - Bishops
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n, i=1, a, b, c, d, x, y;
scanf("%d", &n);
while(n--){
scanf("%d%d%d%d", &a, &b, &c, &d);
printf("Case %d: ", i++);
x=abs(a-c);
y=abs(b-d);
if(x%2==y%2){
if(x==y) printf("1\n");
else printf("2\n");
}
else printf("impossible\n");
}
return 0;
}
|
Sunday, April 24, 2016
Solution of LightOJ 1202 - Bishops
Subscribe to:
Post Comments (Atom)
-
#include<bits/stdc++.h> #define ll long long using namespace std ; ll n , k , t_case ; ll bigmod ( ll b , ll p , ll m...
-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 ...
-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 3...
No comments:
Post a Comment