-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcup finals
30 lines (27 loc) · 894 Bytes
/
cup finals
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
Problem
It is the World Cup Finals. Chef only finds a match interesting if the skill difference of the competing teams is less than or equal to D.
Given that the skills of the teams competing in the final are X and Y respectively, determine whether Chef will find the game interesting or not.
/* package codechef; // don't place package name! */
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 t=sc.nextInt();
for(int i=0;i<t;i++){
int x=sc.nextInt();
int y=sc.nextInt();
int d=sc.nextInt();
int z=Math.abs(x-y);
if(z<=d){
System.out.println("YES");
}else{
System.out.println("NO");
}
}// your code goes here
}
}