let's start Code

1202 - Bishops


 1202 - Bishops

#include<bits/stdc++.h>
using namespace std;
#define MAX 2000100
typedef long long ll;


int main()
{

  #ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
  #endif
    //double start_time = clock();
    int T;

    cin>>T;

    for(int i = 1; i <= T; i++)
    {
        ll r1,c1,r2,c2;
        cin >> r1 >> c1 >> r2 >> c2;
        if((r1+c1)%2 != (r2+c2)%2){
           cout<<"Case "<<i<<": impossible\n";
        }
        else{
           cout<<"Case "<<i<<": ";
           if((r1+c1) == (r2+c2) || ((r1 - c1) == (r2 - c2)))cout << "1\n";
           else cout << "2\n";
        }
    }

   //double end_time = clock();
  //printf( "Time = %lf ms\n", ( (end_time - start_time) / CLOCKS_PER_SEC)*1000);

    return 0;
}


Share:

No comments:

Post a Comment

About

let's start CODE

Popular Posts