Skip to content

Commit

Permalink
Question from CodeChef
Browse files Browse the repository at this point in the history
  • Loading branch information
divyamJi06 committed Oct 1, 2022
1 parent 1dc6eb0 commit 3e0daf8
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Java/CodeChef/q1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// solution to problem : https://www.codechef.com/submit/NEWPIECE


import java.util.*;
import java.lang.*;
import java.io.*;

class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
while(t-->0){
int x = sc.nextInt();
int y = sc.nextInt();
int p = sc.nextInt();
int q = sc.nextInt();
if(x==p && y==q)
System.out.println(0);
else if((x+y)%2==(p+q)%2)
System.out.println(2);
else System.out.println(1);
}
}
}

0 comments on commit 3e0daf8

Please sign in to comment.