-
Notifications
You must be signed in to change notification settings - Fork 0
/
GOOD TURN
35 lines (34 loc) · 890 Bytes
/
GOOD TURN
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
Problem
Chef and Chefina are playing with dice. In one turn, both of them roll their dice at once.
They consider a turn to be good if the sum of the numbers on their dice is greater than 6
Given that in a particular turn Chef and Chefina got
X and Y on their respective dice, find whether the turn was good.
input:= 4
1 4
3 4
4 2
2 6
output:= NO
YES
NO
YES
import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
for(int i=0;i<t;i++){
int a=sc.nextInt();
int b=sc.nextInt();
if(a+b>6){
System.out.println("YES");
}else{
System.out.println("NO");
}
}
}
}