Algorithm


problem Link :https://www.codechef.com/problems/WATERCONS !

Problem

Recently, Chef visited his doctor. The doctor advised Chef to drink at least 2000 ml of water each day.

Chef drank  ml of water today. Determine if Chef followed the doctor's advice or not.

Input Format

  • The first line contains a single integer  — the number of test cases. Then the test cases follow.
  • The first and only line of each test case contains one integer  — the amount of water Chef drank today.

Output Format

For each test case, output YES if Chef followed the doctor's advice of drinking at least 2000 ml of water. Otherwise, output NO.

You may print each character of the string in uppercase or lowercase (for example, the strings YESyEsyes, and yeS will all be treated as identical).

Constraints

  • 1≤�≤2000
  • 1≤�≤4000

Sample 1:

Input
 
Output
 
3
2999
1450
2000
YES
NO
YES

Explanation:

Test case 1: Chef followed the doctor's advice since he drank 2999 ml of water which is ≥2000 ml.

Test case 2: Chef did not follow the doctor's advice since he drank 1450 ml of water which is <2000 ml.

Test case 3: Chef followed the doctor's advice since he drank 2000 ml of water which is ≥2000 ml.

Code Examples

#1 Code Example with C Programming

Code - C Programming

#include<stdio.h>,

int main(void) {
	int x,t;
	scanf("%d",&t);
	while(t--)
	{
	    scanf("%d",&x);
	    if(x>=2000) printf("YES\n");
	    else printf("NO\n");
	}
	return 0;
}
Copy The Code & Try With Live Editor

Input

x
+
cmd
3
2999
1450
2000

Output

x
+
cmd
YES
NO
YES
Advertisements

Demonstration


CodeChef solution WATERCONS  -Water Consumption  Codechef solution in C,C++

Previous
CodeChef solution TAXGIVIN - Saving Taxes CodeCherf solution in C, C++
Next
CodeChef solution FIT - Fitness Codechef solution in C,C++