Problem:
Score: 200 points

Problem Statement

M-kun has the following three cards:

A red card with the integer A.

A green card with the integer B.

A blue card with the integer C.

He is a genius magician who can do the following operation at most K times:

Choose one of the three cards and multiply the written integer by 2.

His magic is successful if both of the following conditions are satisfied after the operations:

The integer on the green card is strictly greater than the integer on the red card.

The integer on the blue card is strictly greater than the integer on the green card.

Determine whether the magic can be successful.

Constraints

1 \leq A, B, C \leq 7

1 \leq K \leq 7

All values in input are integers.

Input

Input is given from Standard Input in the following format:

A B C
K

Output

If the magic can be successful, print Yes; otherwise, print No.

Sample Input 1

7 2 5
3

Sample Output 1

Yes

The magic will be successful if, for example, he does the following operations:

First, choose the blue card. The integers on the red, green, and blue cards are now 7, 2, and 10, respectively.

Second, choose the green card. The integers on the red, green, and blue cards are now 7, 4, and 10, respectively.

Third, choose the green card. The integers on the red, green, and blue cards are now 7, 8, and 10, respectively.

Sample Input 2

7 4 2
3

Sample Output 2

No

He has no way to succeed in the magic with at most three operations.

Solution in C++ (GCC 9.2.1) (judge verdict: Wrong Answer)


/**< 🤣🤣🤣 */
#include<bits/stdc++.h>
using namespace  std ;

using db  = double;
using ll  = long long;
using ull = unsigned long long;
using pII = pair <int, int>;
using pLL = pair <ll, ll>;

#define F                  first
#define S                  second
#define MP                 make_pair
#define PB                 push_back
#define deb(X)             cout << (X) << endl
#define ASH(X)             cout << (X) << " "
#define aLL(X)             X.begin(),X.end()
#define vLL(X)             array<ll,X>
#define s(X)               ((ll)(X).size())
#define deb1(x)            cout << #x << " " << x << endl;
#define deb2(x,y)          cout << #x << " " << x << " " << #y << " " << y << endl;
#define deb3(x,y,z)        cout << #x << " " << x << " " << #y << " " << y <<" "<< #z << " " << z << endl;
#define FOR(I,A,B)         for(ll I = (A); I <= (B); I++)
#define RFOR(I,B,A)        for(ll I = (B); I >=(A); I--)
#define mem0(X)            memset((X), 0, sizeof((X)))
#define mem1(X)            memset((X), -1, sizeof((X)))
#define BS(v,x)            binary_search(v.begin(),v.end(),x)
#define SORT(c)            (sort(c.begin(),c.end()))
#define Time               cerr<<"Time elapsed: "<<1.0*clock()/CLOCKS_PER_SEC<< "sec \n"
#define SORT_UNIQUE(c)     (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x)       (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASES int ___T;    cin >> ___T; for(int cs=1;cs<=___T;cs++)
#define IOS                ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

template<typename T>T gcd(T x, T y){if(y==0)return x;else return gcd(y,x%y);}
ll fx[] = {1, 1, 0, -1, -1, -1, 0, 1};
ll fy[] = {0, 1, 1, 1, 0, -1, -1, -1};
const ll INF   = 1e18;
const int mod  = 1000000007;
const ll L_inf = 9223372036854775807;
const int inf  = 2147483647;
const int mx   = 32000;
bool isprime[mx];

ll POWER(ll y,ll z){ll res=1;while(z){if(z%2==1){res=(res*y)%mod;}y=(y*y)%mod;z>>=1LL;}return res;}
void SIEVE(){for(ll i=2; i<=mx; i++)isprime[i]=true;for(ll i=3; i<=mx; i+=2){if(isprime[i]==true)
{for(ll J=i*i; J<=mx; J+=i)isprime[J]=false;}}}

/************************************************/

void Execute()
{
      ll n, nb, val, q, a, b, k, c, l, r, d, x, y, p, m;

      cin >> a >> b >> c;
      p = a ; q = b; r = c;
      cin >> k;

      ll ok  = 0;
      if(b>a && c>b) ok = 1;




       FOR(i,1,k)
       {
          
           x = i;
           y = k-i;


           while(x--) q*=2;
           while(y--) r*=2;

           if(q>a && r>q)
           {
               ok = 1;
               break;
           }
            q = b;
           r = c;
       }

       if(ok==1) deb("Yes");
       else deb("No");



}

int32_t main()
{
    //#ifndef ONLINE_JUDGE
    //freopen("input.txt", "r", stdin);
   // #endif

    IOS
    //CASES
   // {
        Execute();
        Time;
   // }
}
/**< 🤣🤣🤣 */