Codechef Problems: Protein Diet (LMP1)
Problem Statement
You consume grams of protein daily. A balanced diet requires at least grams of protein per day.
Determine whether your daily protein intake fulfills the recommended requirement. The daily protein intake is considered fulfilled if and only if is greater than or equal to .
Input Format
- The first line of input contains two space-separated integers and - the grams of protein consumed daily and the minimum grams of protein recommended respectively.
Output Format
Print YES if the daily protein intake meets or exceeds the recommended amount.
Otherwise, print NO.
Each letter of the output may be printed in either uppercase or lowercase, i.e, the strings NO, no, No, and nO will all be treated as equivalent.
Constraints
Solution:
Given: X: Daily Protein Intake and Y: Daily Protein Requirement
if ( X >= Y ) -> Means protein intake is Greater than or equals to Protein requirement so it meets the required condition so print YES
else -> Means protein intake is less than protein requirement so it does not meet the required condition so print NO
Code Solution:
#include <bits/stdc++.h>
using namespace std;
int main() {
int x, y;
cin >> x >> y;
if(x >= y){
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
return 0;
}
Comments
Post a Comment