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.



Sample input:
7 2 5
3


Sample output:
Yes

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
k = int(input())

while b <= a:
  b *= 2
  k -=1

while c <= b:
  c *= 2
  k -= 1
  
if k < 0:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
K = int(input())

for i in range((K + 1)):
    for j in range((K + 1) - i):
        for k in range((K + 1) - i - j):
            if A * (2 ** i) < B * (2 ** j) < C * (2 ** k):
                print("Yes")
                exit()

print("No")

Submission status: Accepted

Solution code:
# cook your dish here
a,b,c = map(int, input().split())
k = int(input())
c1, c2 = 0, 0
while b<=a:
    b=b*2
    c1 = c1 + 1
while c <= b:
    c=c*2
    c2 = c2 +1
if c1 + c2 <= k:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
k = int(input())

count = 0
while a >= b:
  b *= 2
  count += 1

while b >= c:
  c *= 2
  count += 1

if count <= k:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
a,b,c,k=map(int,open(0).read().split())
for i in' '*k:
 if a>=b:b*=2
 elif b>=c:c*=2
print('NYoe s'[a<b<c::2])

Submission status: Accepted

Solution code:
R,G,B=map(int,input().split())
K=int(input())
for _ in range (K) :
    if R < G :
        pass
    else:
        G*=2
        continue

    if G < B :
        pass
    else:
        B*=2
        continue
    
if R < G < B :
    print('Yes')
else :
    print('No')

Submission status: Accepted

Solution code:
a=[input() for i in range(2)]
a1=[int(i) for i in a[0].split()]
a2=int(a[1])

count=0

while a1[1]<=a1[0]:
	a1[1]=a1[1]*2
	count+=1

while a1[2]<=a1[1]:
	a1[2]=a1[2]*2
	count+=1

if count<=a2:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
K = int(input())
cnt = 0

while A>=B:
    cnt+=1
    B*=2
while B>=C:
    cnt+=1
    C*=2
print("Yes" if cnt<=K else "No")

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
K=int(input())
d=0
for i in range(K):
  if A>=B:
    B=B*2
  elif B>=C:
    C=C*2
if( B>A and C>B):print("Yes")
else:print("No")

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    A,B,C = map(int,input().split())
    K = int(input())
    count = 0
    while A>=B:
        B *= 2
        count += 1
    while B>=C:
        C *= 2
        count += 1
    print("Yes" if count <= K else "No")

Submission status: Accepted

Solution code:
a,b,c=map(int, input().split())
k=int(input())
cnt=0
while b<=a:
  cnt+=1
  b*=2
while c<=b:
  cnt+=1
  c*=2
if cnt<=k:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split(' '))
k = int(input())
cnt = 0
while a >= b:
    cnt+=1
    b *= 2
while b >= c:
    cnt+=1
    c *= 2

if cnt <= k:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
red, green, blue = map(int, input().split())
k = int(input())

cnt = 0
while red >= green:
    green *= 2
    cnt += 1
while green >= blue:
    blue *= 2
    cnt += 1

if cnt <= k:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
r, g, b = map(int, input().split())
t = 0
while r >= g: g *= 2; t += 1
while g >= b: b *= 2; t += 1
print('No' if t > int(input()) else 'Yes')

Submission status: Accepted

Solution code:
def b_magic2():
    A, B, C = [int(i) for i in input().split()]
    K = int(input())

    count = 0
    while A >= B:
        count += 1
        B *= 2
    while B >= C:
        count += 1
        C *= 2
    return 'Yes' if count <= K else 'No'

print(b_magic2())

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
k = int(input())
for i in range(k):
  if a < b < c:
    break
  elif a >= c  or b >= c:
    c *= 2
  else:
    b *= 2
if a < b < c:
  ans = 'Yes'
else:
  ans = 'No'
print(ans)

Submission status: Accepted

Solution code:
def b_magic2():
    A, B, C = [int(i) for i in input().split()]
    K = int(input())

    for j in range(K + 1):
        for k in range(K + 1):
            if j + k > K:
                break
            if A < B * (2**j) < C * (2**k):
                return 'Yes'
    return 'No'

print(b_magic2())

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
n = int(input())

for i in range(n):

    if a >= b:
        b = b * 2
    elif b >= c:
        c = c * 2
    else:
        print('Yes')
        exit(0)

if a < b < c:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    a = LI()
    k = I()

    t = 0
    for i in range(2):
        while a[i+1] <= a[i]:
            t += 1
            a[i+1] *= 2

    if t <= k:
        return 'Yes'

    return 'No'

print(main())

Submission status: Accepted

Solution code:
A,B,C = (int(i) for i in input().split())

K = int(input())

ans = "No"

for i in range(K):
  if A < B*(2**i) and B*(2**i) < C*(2**(K-i)):
    ans = "Yes"
    break

print(ans)

Submission status: Accepted

Solution code:
R,G,B=map(int,input().split())
K=int(input())

M=0

while R>=G or G>=B:
    if R>=G:
        G*=2
        M+=1
    
    if G>=B:
        B*=2
        M+=1

if M<=K:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
k=int(input())

t=0
while a >= b:
  b *= 2
  t += 1
while b >= c:
  c *= 2
  t += 1
if k >= t:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
A, B, C=map(int,input().split())
K=int(input())
ab=int(A/B)
if ab==0:
  x=0
else:
  x=int(len(bin(ab))-2)
B1=B*(2**x)
bc=int(B1/C)
if bc==0:
  y=0
else:
  y=int(len(bin(bc))-2)
if x+y<=K:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
A,B,C=[int(s) for s in input().split()]
X=int(input())
count=0
while A>=B:
  B*=2
  count+=1
while B>=C:
  C*=2
  count+=1
if count<=X:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
K = int(input())

num = 0
while B <= A:
  B *= 2
  num += 1
while C <= B:
  C *= 2
  num += 1
  
if num > K:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
r,g,b = map(int,input().split())
k = int(input())
t=0
t+=k
for i in range(k):
    if(b<=r):
        b*=2
        t-=1
        
    elif(b>r and b<=g):
        b*=2
        t-=1
        
    elif(b>r and b>g and g<=r):
        g*=2
        t-=1
        
        
    if(t==0):
        break
    
if(g>r and b>g):print("Yes")
else:print("No")

Submission status: Accepted

Solution code:
R,G,B=map(int,input().split())
K=int(input())


for _ in range (K) :
    if R < G :
        pass
    else:
        G*=2
        continue

    if G < B :
        pass
    else:
        B*=2
        continue
    
if R < G < B :
    print('Yes')
else :
    print('No')

Submission status: Accepted

Solution code:
R,G,B=map(int,input().split())
K=int(input())


for i in range (K+1):
    if R < G < B:
        print ('Yes')
        exit()
    else:
        pass
    
    if G < B:
        pass
    else:
        B*=2
        continue

    if R < G:
        pass
    else:
        G*=2
        continue

print('No')

Submission status: Accepted

Solution code:
a,b,c = map(int, input().split())
k = int(input())

t=0
while a >= b:
    b*=2
    t+=1

while b >= c:
    c*=2
    t+=1

if k>=t: print('Yes')
else: print('No')

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    A, B, C = [int(x) for x in input().split()]
    K = int(input())

    cnt = 0

    while A >= B:
        cnt += 1
        B *= 2

    while B >= C:
        cnt += 1
        C *= 2

    if cnt <= K:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
k = int(input())

for i in range(k):
  if(a >= b):
    b*=2
    continue
  if(b >= c):
    c*=2
    continue
    
if(a<b and b<c):
  print("Yes")
  exit()
else:
  print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

a,b,c = LI()
k = I()
cnt1 = 0
while b <= a:
    b *= 2
    cnt1 += 1
cnt2 = 0
while c <= b:
    c *= 2
    cnt2 += 1
if cnt1 + cnt2 <= k:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import copy
def magic(arr,i,k):
  if(k==0):
    if(arr[0] < arr[1] and arr[1] < arr[2]):
      return True
    else:
      return False
  k-=1
  arr[i]*=2
  return magic(arr.copy(),0,k) or magic(arr.copy(),1,k) or magic(arr.copy(),2,k)
  
if __name__ == "__main__":
  arr = list(map(int,input().split()))
  k = int(input())
  if(magic(arr.copy(),0,k) or magic(arr.copy(),1,k) or magic(arr.copy(),2,k)):
    print("Yes")
    exit()
  else:
    print("No")

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
K=int(input())
abc=[A,B,C]
#赤＜緑＜青
for _ in range(K):
    if abc[0]>=abc[1]:
        abc[1]=abc[1]*2
    elif abc[1]>=abc[2]:
        abc[2]=abc[2]*2
    else:
        print("Yes")
        exit()

if abc[0]<abc[1] and abc[1]<abc[2]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import itertools
A,B,C=map(int,input().split())
K=int(input())

l=list(range(K+1))

for c  in itertools.product(l, repeat=3):
    if sum(c) == K and A*2**c[0]<B*2**c[1] and B*2**c[1]<C*2**c[2]:
      print("Yes")
      exit(0)
print("No")

Submission status: Accepted

Solution code:
import sys
r,g,b=map(int,input().split())
k=int(input())

for i in range(k+1):
    if r<g<b:
        print("Yes")
        sys.exit()
    else:
        if r<=b<=g:
            b*=2
        elif b<=r<=g:
            b*=2
        elif b<=g<=r:
            b*=2
        elif g<=r<=b:
            g*=2
        elif g<=b<=r:
            b*=2
print("No")

Submission status: Accepted

Solution code:

# B Magic2
A, B, C = map(int, input().split())
K = int(input())
for i in range(K + 1):  # range()は0からなので+1
    for j in range(K + 1):
        for k in range(K + 1):
            if i + j + k <= K:  # K回以内
                if A * (2 ** i) < B * (2 ** j):
                    if B * (2 ** j) < C * (2 ** k):
                        print("Yes")
                        exit()
print("No")

Submission status: Accepted

Solution code:
import math
import collections
import fractions
import itertools
import functools
import operator

def solve():
    a, b, c = map(int, input().split())
    k = int(input())
    i = k+1
    for p in range(i):
        for q in range(i-p):
            for r in range(i-p-q):
                aa, bb, cc = a, b, c
                for k in range(p):
                    aa*=2
                for k in range(q):
                    bb*=2
                for k in range(r):
                    cc*=2
                if aa < bb < cc:
                    print("Yes")
                    exit()
    print("No")
    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
l = input().split(" ")
a = int(l[0])
b = int(l[1])
c = int(l[2])
k = int(input())
i = 0
while b <= a :
    b = b * 2
    i = i + 1
while c <= b :
    c = c * 2
    i = i + 1
if i <= k :
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import math as mt
import sys, string
from collections import Counter, defaultdict
input = sys.stdin.readline

MOD = 1000000007

# input functions
I = lambda : int(input())
M = lambda : map(int, input().split())
Ms = lambda : map(str, input().split()) 
ARR = lambda: list(map(int, input().split()))

def main():
    a, b, c = M()
    k = I()
    ans = 0
    while b <= a:
        b *= 2
        ans += 1
    while c <= b:
        c *= 2
        ans += 1
    if ans <= k:
        print("Yes")
    else:
        print("No")

# testcases
tc = 1
for _ in range(tc):
    main()

Submission status: Accepted

Solution code:
import itertools
A,B,C=map(int,input().split())
K=int(input())

l=[0,1,2,3,4,5,6,7]

for c  in itertools.product(l, repeat=3):
    if sum(c) == K and A*2**c[0]<B*2**c[1] and B*2**c[1]<C*2**c[2]:
      print("Yes")
      exit(0)
print("No")

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
k = int(input())
for _ in range(k):
    if a >= b:
        b *= 2
    elif b >= c:
        c *= 2
    else:
        pass
if a < b and b < c:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python

a, b, c = map(int, input().split())
k = int(input())

while k>=0:
    if a>=b:
        b *= 2
    elif b>=c:
        c *= 2
    else:
        print('Yes')
        exit(0)
    k -= 1
print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

from pprint import pprint
from collections import deque, defaultdict
import itertools
import math
import sys

sys.setrecursionlimit(10 ** 6)
INF = float('inf')


# r < g < b
r, g, b = map(int, input().split())
k = int(input())


def is_valid(r, g, b, comb):
    for c in comb:
        if c == 'r':
            r *= 2
        elif c == 'g':
            g *= 2
        else:
            b *= 2
    if r < g < b:
        return True
    return False


l = ['r', 'g', 'b']
flag = False
for i in range(k+1):
    if i == 0:
        if is_valid(r, g, b, []):
            flag = True

    combs = list(itertools.combinations_with_replacement(l, i))
    for comb in combs:
        if flag:
            break
        if is_valid(r, g, b, comb):
            flag = True

if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python

a, b, c = map(int, input().split())
k = int(input())

t = 0 
while a>=b:
    b *= 2
    t += 1
while b>=c:
    c *= 2
    t += 1

if t<=k:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
K = int(input())

count = 0
while A >= B:
    B = B * 2
    count += 1

while B >= C:
    C = C * 2
    count += 1

if count <= K:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
K=int(input())

if A<B<C:
    print("Yes")
    exit()
else:
    for k in range(1,K+1):
        for i in range(3**k):
            a,b,c=A,B,C
            for _ in range(k):
                if i%3==0:
                    a*=2
                elif i%3==1:
                    b*=2
                else:
                    c*=2
                i//=3
            if a<b<c:
                print("Yes")
                exit()
print("No")

Submission status: Accepted

Solution code:
A, B, C  = map(int, input().split())
K = int(input())
flg = 0
for i in range(K):
  if B > A:
    if C > B or 2*C > B:
      flg = 1
    else:
        C = 2*C
  else:
    B = 2*B
    continue
if flg:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
d={"a":a,"b":b,"c":c}
for i in range(int(input())+1):
    if d["a"]<d["b"]<d["c"]:
        print("Yes")
        exit()
    elif d["a"]>=d["c"]: d["c"]*=2
    elif d["a"]>=d["b"]: d["b"]*=2
    elif d["b"]>=d["c"]: d["c"]*=2
print("No")

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
k = int(input())
cnt = 0

while a >= b:
    b *= 2
    cnt += 1

while b >= c:
    c *= 2
    cnt += 1

print('Yes' if cnt <= k else 'No')

Submission status: Accepted

Solution code:
r, g, b = [int(x) for x in input().split()]
ops = int(input())
m = 0
while g <= r:
        g *= 2
        m += 1
while b <= g:
        b *= 2
        m += 1
print("Yes" if m <= ops  else "No")

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
K = int(input())
yes = False
for i in range(0, 8):
    for j in range(0, 8):
        for k in range(0, 8):
            if i + j + k == K:
                new_A = A * (2 ** i)
                new_B = B * (2 ** j)
                new_C = C * (2 ** k)
                if new_C > new_B and new_B > new_A:
                    yes = True
                    break
        if yes:
            break
    if yes:
        break
                
if yes:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())
K = int(input())

ans = 0
while B<=A:
    ans += 1
    B *= 2

while C<=B:
    ans += 1
    C *= 2

print("Yes" if ans <= K else "No")

Submission status: Accepted

Solution code:
import itertools

def check(targets):
    if targets[1] > targets[0] and targets[2] > targets[1]:
        return True
    else:
        return False


if __name__ == "__main__":
    A, B, C = map(int, input().split())
    K = int(input())
    targets = [A, B, C]
    answer = 'No'

    cases = itertools.product([0, 1, 2], repeat=K)
    for case in cases:
        copy_targets = targets.copy()
        for i in case:
            copy_targets[i] = copy_targets[i] * 2
        if check(copy_targets):
            answer = 'Yes'
            break

    print(answer)

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
k = int(input())

if a >= b:
    while a >= b:
        if k == 0:
            print("No")
            exit()
        b *= 2
        k -= 1

if b >= c:
    while b >= c:
        if k == 0:
            print("No")
            exit()
        c *= 2
        k -= 1

print("Yes")

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
k = int(input())
for x in range(k + 1):
	for y in range(k + 1):
		for z in range(k + 1):
			if a * 2**x < b * 2**y and b * 2**y < c * 2**z and x + y + z <= k:
				print("Yes")
				exit()
print("No")

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
k = int(input())
while a >= b and k > 0:
    b *= 2
    k -= 1
while b >= c and k > 0:
    c *= 2
    k -= 1
print('Yes' if a < b < c else 'No')

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
K = int(input())

for _ in range(K):
    if A >= B:
        B *= 2
    elif B >= C:
        C *= 2

if A < B < C:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

def get_input() -> tuple:
    """
    標準入力を取得する.

    Returns:\n
        tuple: 標準入力
    """
    A, B, C = list(map(int, input().split()))
    K = int(input())

    return A, B, C, K

def main(A: int, B: int, C: int, K: int) -> None:
    """
    メイン処理.

    Args:\n
        A (int): 整数（1 <= A <= 7）
        B (int): 整数（1 <= B <= 7）
        C (int): 整数（1 <= C <= 7）
        K (int): 操作回数（1 <= K <= 7）
    """
    # 求解処理
    cnt = 0
    while A >= B:
        cnt += 1
        B *= 2
    while B >= C:
        cnt += 1
        C *= 2

    # 結果出力
    if cnt <= K:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    # 標準入力を取得
    A, B, C, K = get_input()

    # メイン処理
    main(A, B, C, K)

Submission status: Accepted

Solution code:
def main():
    a, b, c = [int(x) for x in input().split()]
    count = int(input())

    while a >= b:
        b *= 2
        count -= 1
    while b >= c:
        c *= 2
        count -= 1

    print('Yes' if count >= 0 else 'No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
K = int(input())
while B <= A:
  B *= 2
  K -= 1
while C <= B:
  C *= 2
  K -= 1
print("Yes" if K >= 0 else "No")

Submission status: Accepted

Solution code:
 
# from math import factorial as fac
from collections import defaultdict
# from copy import deepcopy
import sys, math
f = None
try:
	f = open('q1.input', 'r')
except IOError:
	f = sys.stdin
if 'xrange' in dir(__builtins__):
	range = xrange
# print(f.readline())
# sys.setrecursionlimit(10**6)

	
def print_case_iterable(case_num, iterable):
	print("Case #{}: {}".format(case_num," ".join(map(str,iterable))))

def print_case_number(case_num, iterable):
	print("Case #{}: {}".format(case_num,iterable))

def print_iterable(A):
	print (' '.join(A))

def read_int():
	return int(f.readline().strip())
def read_int_array():
	return [int(x) for x in f.readline().strip().split(" ")]
def rns():
	a =  [x for x in f.readline().split(" ")]
	return int(a[0]), a[1].strip()
def read_string():
	return list(f.readline().strip())
def ri():
	return int(f.readline().strip())
def ria():
	return [int(x) for x in f.readline().strip().split(" ")]
def rns():
	a =  [x for x in f.readline().split(" ")]
	return int(a[0]), a[1].strip()
def rs():
	return list(f.readline().strip())
def bi(x):
	return bin(x)[2:]





from collections import deque
import math
NUMBER = 10**9 + 7
# NUMBER = 998244353
def factorial(n) : 
	M = NUMBER
	f = 1
  
	for i in range(1, n + 1):  
		f = (f * i) % M # Now f never can  
						# exceed 10^9+7  
	return f
def mult(a,b):
	return (a * b) % NUMBER

def minus(a , b):
	return (a - b) % NUMBER

def plus(a , b):
	return (a + b) % NUMBER

def egcd(a, b):
	if a == 0:
		return (b, 0, 1)
	else:
		g, y, x = egcd(b % a, a)
		return (g, x - (b // a) * y, y)

def modinv(a):
	m = NUMBER
	g, x, y = egcd(a, m)
	if g != 1:
		raise Exception('modular inverse does not exist')
	else:
		return x % m
def choose(n,k):
	if n < k:
		assert false
	return  mult(factorial(n), modinv(mult(factorial(k),factorial(n-k)))) % NUMBER
from collections import deque, defaultdict 
import heapq


from types import GeneratorType
def bootstrap(f, stack=[]):
	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to

	return wrappedfunc


def dfs(g, timeIn, timeOut,depths,parents): 
	# assign In-time to node u 
	cnt = 0
	# node, neig_i, parent, depth
	stack = [[1,0,0,0]]
	while stack:
		v,neig_i,parent,depth = stack[-1]
		parents[v] = parent
		depths[v] = depth
		# print (v)
		if neig_i == 0:
			timeIn[v] = cnt    
			cnt+=1
		while neig_i < len(g[v]):
			u = g[v][neig_i]
			if u == parent:
				neig_i+=1
				continue
			stack[-1][1] = neig_i + 1
			stack.append([u,0,v,depth+1])
			break
		if neig_i == len(g[v]):
			stack.pop()
			timeOut[v] = cnt
			cnt += 1
  
# def isAncestor(u: int, v: int, timeIn: list, timeOut: list) -> str: 
# 	return timeIn[u] <= timeIn[v] and timeOut[v] <= timeOut[u] 

cnt = 0
@bootstrap
def dfs(v,adj,timeIn, timeOut,depths,parents,parent=0,depth=0):
	global cnt
	parents[v] = parent
	depths[v] = depth
	timeIn[v] = cnt
	cnt+=1
	for u in adj[v]:
		if u == parent:
			continue
		yield dfs(u,adj,timeIn,timeOut,depths,parents,v,depth+1)
	timeOut[v] = cnt
	cnt+=1
	yield 

def gcd(a,b): 
	if a == 0: 
		return b 
	return gcd(b % a, a) 
  
# Function to return LCM of two numbers 
def lcm(a,b): 
	return (a*b) / gcd(a,b) 
def get_num_2_5(n):
	twos = 0
	fives = 0
	while n>0 and n%2 == 0:
		n//=2
		twos+=1
	while n>0 and n%5 == 0:
		n//=5
		fives+=1
	return (twos,fives)
def shift(a,i,num):
	for _ in range(num):
		a[i],a[i+1],a[i+2] = a[i+2],a[i],a[i+1]

def equal(x,y):
	return abs(x-y) <= 1e-9
# def leq(x,y):
# 	return x-y <= 1e-9
def getAngle(a, b, c):
	ang = math.degrees(math.atan2(c[1]-b[1], c[0]-b[0]) - math.atan2(a[1]-b[1], a[0]-b[0]))
	return ang + 360 if ang < 0 else ang
def getLength(a,b):
	return math.sqrt((a[0]-b[0])**2 + (a[1]-b[1])**2)


from heapq import heapify, heappush, heappop

def bfs(adj):
	s = set()
	d = defaultdict(set)
	# print('\n'.join(map(str,E.items())))
	q = deque([])
	s.add(0)
	d[0].add(0)
	q.append((0,0))
	while len(q) > 0:
		v,depth = q.popleft()
		for u in adj[v]:
			if u not in s:
				s.add(u)
				d[depth+1].add(u)
				q.append((u,depth+1))
		# print(q)
	return d



def isSubsetSum(arr, n, summ): 
	  
	# The value of subarr[i][j] will be  
	# true if there is a 
	# subarr of arr[0..j-1] with summ equal to i 
	subarr =([[False for i in range(summ + 1)]  
			for i in range(n + 1)]) 
	  
	# If summ is 0, then answer is true  
	for i in range(n + 1): 
		subarr[i][0] = True
		  
	# If summ is not 0 and arr is empty,  
	# then answer is false  
	for i in range(1, summ + 1): 
		 subarr[0][i]= False
			  
	# Fill the subarr table in botton up manner 
	for i in range(1, n + 1): 
		for j in range(1, summ + 1): 
			if j<arr[i-1]: 
				subarr[i][j] = subarr[i-1][j] 
			if j>= arr[i-1]: 
				subarr[i][j] = (subarr[i-1][j] or 
								subarr[i - 1][j-arr[i-1]]) 
	  
	# uncomment this code to print table  
	# for i in range(n + 1): 
	# for j in range(summ + 1): 
	# print (subset[i][j], end =" ") 
	# print() 
	return subarr[n][summ] 

@bootstrap
def dfs(v,adj,vis,black):
	vis[v] = 1
	for u in adj[v]:
		if vis[u]==2:
			continue
		if vis[u] == 1:
			black.add((v,u)) 
			continue
		yield dfs(u,adj,vis,black)
	vis[v] = 2
	yield


def solution(a,b,c,k):
	cnt= 0
	while b <= a:
		b*=2
		cnt+=1
	while c <= b:
		c*=2
		cnt+=1
	return "Yes" if cnt <= k else "No"


def main():
	T = 1
	# T = ri()
	for i in range(T):
		# n = ri()
		# n,m = ria()
		# a = ria()
		a,b,c = ria()
		k = ri()
		# s = rs()
		# b = rs()
		# n,k,l	= ria()
		# a = ria()
		# adj = [list() for _ in range(n)]
		# for _ in range(m):
		# 	a,b=ria();
		# 	a-=1; b-=1
		# 	adj[a].append(b)

		x = solution(a,b,c,k)

		# continue
		if 'xrange' not in dir(__builtins__):
			print(x) # print("Case #"+str(i+1)+':',x)
		else:
			print >>output,str(x)
	if 'xrange' in dir(__builtins__):
		print(output.getvalue())
		output.close()

if 'xrange' in dir(__builtins__):
	import cStringIO
	output = cStringIO.StringIO()
#example usage:
#    for l in res:
#       print >>output, str(len(l)) + ' ' +  ' '.join(l)

if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
k = int(input())


s = 0
while a>=b:
  b *= 2
  s +=1
while b>=c:
  c *= 2
  s +=1
if s <= k:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
k = int(input())
while k>0 and not (a<b<c):
    if a>=b:
        b *= 2
        k -= 1
    elif b>=c:
        c *= 2
        k -= 1
print('Yes' if a<b<c else 'No')

Submission status: Accepted

Solution code:
def main():
    a,b,c = map(int,input().split())
    k = int(input())

    i = 0
    while a >= b:
        b *= 2
        i += 1
    while b >= c:
        c *= 2
        i += 1
    print("Yes" if i <= k else "No")

if __name__ == '__main__':
    main()