Problem Code:NEWPIECE Answer

 

 

#include <bits/stdc++.h>

#include <iostream>
 
using namespace std;

int main()

{

	// your code goes here

	int t, e, f, g, h;

	cin >> t;

	while (t--)

	{

		cin >> e >> f;

		cin >> g >> h;

		int z = e + f;

		int q = g + h;

		if (e == g && f == h)

		{

			cout << "0";

		}

		else if ((z % 2 == 0 && q % 2 == 0) || (z % 2 != 0 && q % 2 != 0))

		{

			cout << "2";

		}

		else if ((z % 2 == 0 && q % 2 != 0) || (z % 2 != 0 && q % 2 == 0))

		{

			cout << "1";

		}

		cout << endl;

	}

	return 0;

}


	

Post a Comment

3 Comments

  1. only one test passed

    ReplyDelete
    Replies
    1. Check Now brother. Its working. correct answer.

      Delete
  2. This comment has been removed by a blog administrator.

    ReplyDelete