Algorithm
problem Link : https://www.codechef.com/problems/CBSPEED
Problem
In ChefLand, human brain speed is measured in bits per second (bps). Chef has a threshold limit of bits per second above which his calculations are prone to errors. If Chef is currently working at bits per second, is he prone to errors?
If Chef is prone to errors print YES
, otherwise print NO
.
Input Format
The only line of input contains two space separated integers and — the threshold limit and the rate at which Chef is currently working at.
Output Format
If Chef is prone to errors print YES
, otherwise print NO
.
You may print each character of the string in uppercase or lowercase (for example, the strings yes
, Yes
, yEs
, and YES
will all be treated as identical).
Constraints
Sample 1:
7 9
YES
Explanation:
Chef's current brain speed of bps is greater than the threshold of bps, hence Chef is prone to errors.
Sample 2:
6 6
NO
Explanation:
Chef's current brain speed of bps is not greater than the threshold of bps, hence Chef is not prone to errors.
Sample 3:
31 53
YES
Explanation:
Chef's current brain speed of bps is greater than the threshold of bps, hence Chef is prone to errors.
Sample 4:
53 8
NO
Explanation:
Chef's current brain speed of bps is not greater than the threshold of bps, hence Chef is not prone to errors.
Code Examples
#1 Code Example with C Programming
Code -
C Programming
#include<stdio.h> int main() { int x,y; scanf("%d %d",&x,&y); if(x<y) printf("YES\n"); else printf("NO\n">; }Copy The Code & Try With Live Editor
Input
Output
Demonstration
CodeChef solution CBSPEED - Chef and Brain Speed Codechef solution in C,C++