Algorithm
problem Link : https://github.com/ShazidMashrafi/Codechef-Solutions
Problem
A person is said to be sleep deprived if he slept strictly less than 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, yes
, yEs
, Yes
will be considered identical).
Constraints
Sample 1:
3 4 7 10
YES NO NO
Explanation:
Test Case 1: Since , Chef is sleep deprived.
Test Case 2: Since , Chef is not sleep deprived.
Test Case 3: Since , 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
Output
Demonstration
CodeChef solution SLEEP - Sleep deprivation Codechef solution in C,C++