Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Chef’s son wants to go on a roller coaster ride. The height of Chef’s son is X inches while the minimum height required to go on the ride is H inches. Determine whether he can go on the ride or not.
For each test case, output in a single line, YES
if Chef’s son can go on the ride. Otherwise, output NO
.
You may print each character of YES
and NO
in uppercase or lowercase (for example, yes
, yEs
, Yes
will be considered identical)
Input: 4
15 20
50 48
32 32
38 39
Output: NO
YES
YES
NO
Test case 1: Chef’s son can not go on the ride as his height < the minimum required height.
Test case 2: Chef’s son can go on the ride as his height ≥ the minimum required height.
Test case 3: Chef’s son can go on the ride as his height ≥ the minimum required height.
Test case 4: Chef’s son can not go on the ride as his height < the minimum required height.
#include <iostream>
using namespace std;
int main() {
int T,X,H;
cin>>T;
for(int i=0;i<T;i++){
cin>>X>>H;
if(X>=H){
cout<<"Yes"<<endl;
}
else{
cout<<"No"<<endl;
}
}
return 0;
}
t=int(input())
for i in range(t):
X,H=map(int,input().split())
if H<=X:
print("YES")
else:
print("NO")
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 x = sc.nextInt();
int h = sc.nextInt();
if(x>=h){
System.out.println("YES");
}
else{
System.out.println("NO");
}
}
}
}
In our experience, we suggest you solve this Roller Coaster CodeChef Solution and gain some new skills from Professionals completely free and we assure you will be worth it.
If you are stuck anywhere between any coding problem, just visit Queslers to get the Roller Coaster CodeChef Solution
I hope this Roller Coaster CodeChef Solution would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.
This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.
Keep Learning!
More Coding Solutions >>