Problem
Given the time control of a chess match as , determine which format of chess out of the given it belongs to.
Chef if
Cfenia if
Chefina if
Cf if
Input Format
- First line will contain , number of testcases. Then the testcases follow.
- Each testcase contains a single line of input, two integers .
Output Format
For each testcase, output in a single line.
Constraints
Subtasks
Sample 1:
4 1 0 4 1 100 0 20 5
1 2 4 3
Explanation:
TestCase : Since .
TestCase : Since .
Program :
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc= new Scanner(System.in);
int n=sc.nextInt();
while(n-->0){
int a=sc.nextInt();
int b=sc.nextInt();
int c= a+b;
if(c<3)
{
System.out.println("1");
}
else if(c>=3 && c<=10)
{
System.out.println("2");
}
else if(c>=11 && c<=60)
{
System.out.println("3");
}
else
{
System.out.println("4");
}
}
}
}
0 Comments