-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIncrease IQ solution
58 lines (44 loc) · 1.65 KB
/
Increase IQ solution
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
Problem
A study has shown that playing a musical instrument helps in increasing one's IQ by 77 points. Chef knows he can't beat Einstein in physics, but he wants to try to beat him in an IQ competition.
You know that Einstein had an IQ of 170170, and Chef currently has an IQ of XX.
Determine if, after learning to play a musical instrument, Chef's IQ will become strictly greater than Einstein's.
Print "Yes" if it is possible for Chef to beat Einstein, else print "No" (without quotes).
You may print each character of the string in either uppercase or lowercase (for example, the strings yEs, yes, Yes, and YES will all be treated as identical).
Input Format
The first and only line of input will contain a single integer XX, the current IQ of Chef.
Output Format
For each testcase, output in a single line "Yes" or "No"
You may print each character of the string in either uppercase or lowercase (for example, the strings yEs, yes, Yes, and YES will all be treated as identical).
Constraints
100 \leq X \leq 169100≤X≤169
Subtasks
Subtask #1 (100 points): Original constraints
Sample 1:
Input
Output
165
Yes
Explanation:
After learning a musical instrument, Chef's final IQ will be 165+7=172165+7=172. Since 172 \gt 170172>170, Chef can beat Einstein.
Sample 2:
Input
Output
120
No
Explanation:
After learning a musical instrument, Chef's final IQ will be 120+7=127120+7=127. Since 127 \lt 170127<170, Chef cannot beat Einstein.
solution :
#include <iostream>
using namespace std;
int main() {
int X, iq;
cin >> X;
iq = X + 7;
if (iq > 170){
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
return 0;
}