Algorithm


problem Link : https://github.com/ShazidMashrafi/Codechef-Solutions 

Problem

A person is said to be sleep deprived if he slept strictly less than 7 hours in a day.

Chef was only able to sleep  hours yesterday. Determine if he is sleep deprived 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 number of hours Chef slept.

Output Format

For each test case, output YES if Chef is sleep-deprived. Otherwise, output NO.

You may print each character of YES and NO in uppercase or lowercase (for example, yesyEsYes will be considered identical).

Constraints

  • 1≤�≤20
  • 1≤�≤15

Sample 1:

Input
 
Output
 
3
4
7
10
YES
NO
NO

Explanation:

Test Case 1: Since 4<7, Chef is sleep deprived.

Test Case 2: Since 7≥7, Chef is not sleep deprived.

Test Case 3: Since 10≥7, Chef is not sleep deprived.

Code Examples

#1 Code Example with C Programming

Code - C Programming

#include<stdio.h>  
int main()
{
    int t,x;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d",&x);
        if(x>=7) printf("NO\n");
        else printf("Yes\n");
    }
}.
Copy The Code & Try With Live Editor

Input

x
+
cmd
3 4 7 10

Output

x
+
cmd
YES NO NO
Advertisements

Demonstration


CodeChef solution SLEEP  - Sleep deprivation Codechef solution in C,C++

Previous
CodeChef solution CHESSTIME - Chess Time Codechef solution in C,C++
Next
CodeChef solution INVESTMENT - Good Investment or Not solution in C,C++