-
Notifications
You must be signed in to change notification settings - Fork 0
/
Audible Range
66 lines (50 loc) · 1.68 KB
/
Audible Range
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Problem
Chef's dog binary hears frequencies starting from 6767 Hertz to 4500045000 Hertz (both inclusive).
If Chef's commands have a frequency of XX Hertz, find whether binary can hear them or not.
Input Format
The first line of input will contain a single integer TT, denoting the number of test cases.
Each test case consists of a single integer XX - the frequency of Chef's commands in Hertz.
Output Format
For each test case, output on a new line YES, if binary can hear Chef's commands. Otherwise, print NO.
The output is case-insensitive. Thus, the strings YES, yes, yeS, and Yes are all considered the same.
Constraints
1 \leq T \leq 10^41≤T≤10
4
1 \leq X \leq 10^61≤X≤10
6
Sample 1:
Input
Output
5
42
67
402
45000
45005
NO
YES
YES
YES
NO
Explanation:
Test case 11: Chef's command has a frequency of 4242 Hertz which is less than 6767. Thus, it would not be audible to binary.
Test case 22: Chef's command has a frequency of 6767 Hertz which lies in the range [67, 45000][67,45000]. Thus, it would be audible to binary.
Test case 33: Chef's command has a frequency of 402402 Hertz which lies in the range [67, 45000][67,45000]. Thus, it would be audible to binary.
Test case 44: Chef's command has a frequency of 4500045000 Hertz which lies in the range [67, 45000][67,45000]. Thus, it would be audible to binary.
Test case 55: Chef's command has a frequency of 4500545005 Hertz which is greater than 4500045000. Thus, it would not be audible to binary.
#include <iostream>
using namespace std;
int main()
{
int T,X;
cin>>T;
while(T--)
{
cin>>X;
if(X>=67 && X<=45000)
cout<<"\nYES";
else
cout<<"\nNO";
}
return 0;
}