Chef has his lunch only between 11 pm and 44 pm (both inclusive).
Given that the current time is đť‘‹X pm, find out whether it is lunchtime for Chef.
Input Format
- The first line of input will contain a single integer 𝑇T, the number of test cases. Then the test cases follow.
- Each test case contains a single line of input, containing one integer 𝑋X.
Output Format
For each test case, print in a single line YESYES if it is lunchtime for Chef. Otherwise, print NONO.
You may print each character of the string in either uppercase or lowercase (for example, the strings YeSYeS, yEsyEs, yesyes and YESYES will all be treated as identical).
Constraints
- 1≤𝑇≤121≤T≤12
- 1≤𝑋≤121≤X≤12
Sample 1
Inputcopy | Outputcopy |
---|---|
3 1 7 3 | YES NO YES |
Test case 11: Lunchtime is between 11 pm and 44 pm (both inclusive). Since 11 pm lies within lunchtime, the answer is YESYES.
Test case 22: Lunchtime is between 11 pm and 44 pm (both inclusive). Since 77 pm lies outside lunchtime, the answer is NONO.
Test case 33: Lunchtime is between 11 pm and 44 pm (both inclusive). Since 33 pm lies within lunchtime, the answer is YESYES.
Solutions:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int T = scanner.nextInt();
for (int i = 0; i < T; i++) {
int X = scanner.nextInt();
if (X >= 1 && X <= 4) {
System.out.println("YES");
} else {
System.out.println("NO");
}
}
scanner.close();
}
}