-
Notifications
You must be signed in to change notification settings - Fork 0
/
Miami GP
34 lines (29 loc) · 1.04 KB
/
Miami GP
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
Miami GP
Problem
Chef has finally got the chance of his lifetime to drive in the F1 tournament.
But, there is one problem. Chef did not know about the 107% rule and now he is worried whether he will be allowed to race in the main event or not.
Given the fastest finish time as X seconds and Chef's finish time as Y seconds,
determine whether Chef will be allowed to race in the main event or not.
Note that, Chef will only be allowed to race if his finish time is within 107% of the fastest finish time.
/* 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 a=sc.nextInt();
if(x*1.07>=a){
System.out.println("YES");
}else{
System.out.println("NO");
}
}// your code goes here
}
}