INCRIQ - Editorial

PROBLEM LINK:

Contest Division 1
Contest Division 2
Contest Division 3
Contest Division 4

Setter: Nandeesh Gupta
Tester: Abhinav Sharma, Aryan
Editorialist: Lavish Gupta

DIFFICULTY:

Cakewalk

PREREQUISITES:

None

PROBLEM:

A study has shown that playing a musical instrument helps in increasing one’s IQ by 7 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 170, and Chef currently has an IQ of X.

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).

EXPLANATION:

What will be the Chef's IQ after learning to play a musical instrument?

Before learning a musical instrument, Chef’s IQ is X. It is known that playing a musical instrument helps in increasing one’s IQ by 7. So, Chef’s IQ after learning to play a musical instrument will become X+7.

When will the Chef's IQ become strictly greater than Einstein's after learning to play a musical instrument?

Chef’s IQ after learning to play a musical instrument will be X+7. For this to become strictly greater than Einstein’s IQ, which is 170, we have X+7 \gt 170 \implies X \gt 163.

TIME COMPLEXITY:

O(1) for each test case.

SOLUTION:

Editorialist's Solution
#include<bits/stdc++.h>
using namespace std ;

int main()
{
    int x ;
    cin >> x ;
    if(x > 163)
        cout << "Yes\n" ;
    else
        cout << "No\n" ;

    return 0;
}