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 (Python):
from math import sqrt,ceil,gcd
def ii():return int(input())
def si():return input()
def mi():return map(int,input().split())
def li():return list(mi())




a,b,c=mi()
k=ii()
for i in range(k):
    if a>=b:
        b*=2
    else:
        c*=2
    if a<b<c:
        break

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

Solution (Python):
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    a, b, c = MI()
    k = I()
    res = k
    flag = True
    if b <= a:
        for i in range(k):
            b *= 2
            res -= 1
            if b > a:
                break
        else:
            flag = False
    if c <= b:
        for i in range(res):
            c *= 2
            res -= 1
            if c > b:
                break
        else:
            flag = False
    if flag:
        print('Yes')
    else:
        print('No')



if __name__ == '__main__':
    main()

Solution (Python):
""" B
    https://atcoder.jp/contests/m-solutions2020/tasks/m_solutions2020_b
"""
import sys
import math
from functools import reduce
from bisect import bisect_left

def readString():
    return sys.stdin.readline()

def readInteger():
    return int(readString())

def readStringSet(n):
    return sys.stdin.readline().split(" ")[:n]

def readIntegerSet(n):
    return list(map(int, readStringSet(n)))

def readIntegerMatrix(n, m):
    return reduce(lambda acc, _: acc + [readIntegerSet(m)], range(0, n), [])

def main(A, B, C, K):
    while A >= B:
        if K == 0:
            return "No"
        B *= 2
        K -= 1
    while B >= C:
        if K == 0:
            return "No"
        C *= 2
        K -= 1

    return "Yes"

if __name__ == "__main__":
    _A, _B, _C = readIntegerSet(3)
    _K = readInteger()

    print(main(_A, _B, _C, _K))

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

ans = False
tmp_a = a
tmp_b = b
tmp_c = c

for i in range(0,k+1):
  for j in range(0,k+1):
    for l in range(0,k+1):
      tmp_a *= pow(2,i)
      tmp_b *= pow(2,j)
      tmp_c *= pow(2,l)
      if tmp_a < tmp_b and tmp_b < tmp_c and i + j + l <= k:
        ans = True
        break
      tmp_a = a
      tmp_b = b
      tmp_c = c

if ans:
  print("Yes")
else:
  print("No")

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

Solution (Python):
def function(numbers, K):
    ans = 'No'
    for i in range(K+1):
        A = int(numbers[0])
        B = int(numbers[1])
        C = int(numbers[2])
        B = B*2**i
        C = C*2**(K-i)
        if (B > A) & (C > B):
            ans = 'Yes'
    return ans


if __name__ == '__main__':
    numbers = input().split()
    K = int(input())
    print(function(numbers, K))

Solution (Python):
from sys import stdin

def main():
    a, b, c = [int(x) for x in stdin.readline().rstrip().split()]
    k = int(input())

    n = 0
    bb = b
    while bb <= a:
        bb = bb * 2
        n += 1
    
    if n > k:
        print("No")
        return

    m = k - n

    cc = c
    for i in range(m):
        cc = cc * 2

    if cc > bb:
        print("Yes")
    else:
        print("No")
    
    

if __name__ == "__main__":
    main()

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

magic=0

while A>=B and magic < K:
    B*=2
    magic+=1

while B>=C and magic < K:
    C*=2
    magic+=1

if C > B > A:
    print("Yes")
else:
    print("No")

Solution (Python):


import sys
from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union































def main():
    Num = Union[int, float]
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input():  return sys.stdin.readline().rstrip()
    def ii():     return int(input())
    def isp():    return input().split()
    def mi():     return map(int, input().split())
    def mi_0():   return map(lambda x: int(x)-1, input().split())
    def lmi():    return list(map(int, input().split()))
    def lmi_0():  return list(map(lambda x: int(x)-1, input().split()))
    def li():     return list(input())
    def debug(x): print(x, file=sys.stderr)
    

    def calc_op(a, b, c):
        cnt = 0
        while a >= b:
            cnt += 1
            b *= 2
        while b >= c:
            cnt += 1
            c *= 2
        return cnt
    
    
    a, b, c = mi()
    k = ii()
    print('Yes') if calc_op(a, b, c) <= k else print('No')


if __name__ == "__main__":
    main()

Solution (Python):
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

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

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

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())
cnt = 0
while B <= A:
    B *= 2
    cnt += 1
while C <= B:
    C *= 2
    cnt += 1
if cnt <= K :
    print('Yes') 
else:
    print('No')

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

for _ in range(k):
  if a >= b:
    b = b * 2
  elif b >= c:
    c = c * 2
    
if a < b < c:
  print("Yes")
else:
  print("No")

Solution (Python):
aka,midori,ao=map(int,input().split())
K = int(input())
count = 1
while count <= K-1:
    if aka>=midori:
        midori = midori*2
        count = count+1
    else:
        break
while count <= K:
    if midori>=ao:
        ao = ao*2
        count = count+1
    else:
        break
if aka<midori:
    if midori<ao:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Solution (Python):
a, b, c = map(int, input().split())
K = int(input())

for i in range(K+1):
    for j in range(K+1-i):
        k = K - i - j
        
        if a * 2**i < b * 2**j and b * 2**j < c * 2**k:
            print("Yes")
            exit()
print("No")

Solution (Python):
A,B,C=map(int,input().split())
K=int(input())
i=-1
if B<=A:
    for i in range(K):
        B*=2
        if B>A:
            break
if C<=B:
    for j in range(K-i-1):
        C*=2
if A<B and B<C:
    print("Yes")
else:
    print("No")

Solution (Python):
from itertools import product

cards = list(map(int, input().split()))
k = int(input())

seed = [0,1,2]
lists = []

cnt = 0

for _ in range(k):
  lists.append(seed)
  
for pattern in product(*lists):
  tmp_cards = cards.copy()
  flag = True
  for choise in pattern:
    tmp_cards[choise]*=2
  if (tmp_cards[1] > tmp_cards[0]) and (tmp_cards[2] > tmp_cards[1]):
    cnt+=1

if cnt==0:
  print('No')
else:
  print('Yes')

Solution (Python):
import sys


def resolve(in_):
    a, b, c = map(int, next(in_).split())
    k = int(next(in_))
    for _ in range(k):
        if a >= b:
            b *= 2
        elif b >= c:
            c *= 2
        else:
            break
    return 'Yes' if a < b and b < c else 'No'


def main():
    answer = resolve(sys.stdin.buffer)
    print(answer)


if __name__ == '__main__':
    main()

Solution (Python):
A,B,C=map(int,input().split())
K=int(input())
a=A
b=B
c=C
ans=0
for i in range(8):
  if b<=a:
    b*=2
    ans+=1
for i in range(8):
  if c<=b:
    c*=2
    ans+=1
if ans<=K:
  print('Yes')
else:
  print('No')

Solution (Python):
a,b,c = map(int,input().split())
k = int(input())
ans = "No"
for i in range(k):
    if a>=b:
        b*=2
    elif b>=c:
        c*=2
if b>a and c>b:
    ans = "Yes"
print(ans)

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

for i in range(K + 1):
  for j in range(0, K + 1 - i):
    b = B * (2 ** i)
    c = C * (2 ** j)
    if A < b < c:
      print("Yes")
      quit()
      
print("No")

Solution (Python):
array = list(map(int, input().split(' ')))

K = int(input())

for i in range(K):
  if array[2] == max(array):
    if array[0] >= array[1]:
      array[1] = array[1] * 2
    else:
      array[2] = array [2] * 2
  else:
    array[2] = array[2] * 2

if array[0] < array[1] and array[1] < array[2]:
  print('Yes')
else:
  print('No')

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

flag = True

for i in range(k):
  if a >= b:
    b*= 2
  elif b >= c:
    c *= 2

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

Solution (Python):
a = input().split(" ")
b = int(a[1])
c = int(a[2])
a = int(a[0])
k = int(input())
check=0
while True:
  if check == k:
    if int(c) > int(b) and int(b) > int(a): 
      print("Yes")
      break;
    else:
      print("No")
      break;
  else:
    if int(c) <= int(b):
      c = c*2
      check += 1
    elif int(b) <= int(a):
      b = b*2
      check += 1
    else:
      c = c*2
      check += 1

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())
tf2 = True
while True:
  if b > a:
    break
  else:
    b *= 2
    k -= 1
    if k < 0:
      print("No")
      tf2 = False
      break
while tf2:
  if c > b:
    print("Yes")
    break
  else:
    c *= 2
    k -= 1
    if k < 0:
      print("No")
      break

Solution (Python):
a,b,c = list(map(int,input().split()))
k = int(input())
for i in range(k):
    if a >= b:
        b = 2*b
    elif b >= c:
        c = 2*c

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

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

need1=0
need2=0
while True:
    if a>=b:
        b *=2
        need1+=1
    else:
        break

while True:
    if b>=c:
        c *=2
        need2+=1
    else:
        break

ans = need1 + need2

if k>=ans:
    print("Yes")
else:
    print("No")

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

ans = False
while K >= 0:
    if A >= B:
        B = B * 2
        K -= 1
    elif B >= C:
        C = C * 2
        K -= 1
    else:
        ans = True
        break

print('Yes' if ans else 'No')

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

ans = "No"
cnt = 0
while cnt < K:
    if A >= B:
        B *= 2
    elif B >= C:
        C *= 2

    if A < B and B < C:
        ans = "Yes"
        break
    cnt += 1

print(ans)

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

for i in range(k):
    if a < b:
        c *= 2
    else:
        b *= 2

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

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

for i in range(K):
    tmp = min(B,C)
    if(B==C):
        C *= 2
    elif(2*B >= C):
        C *= 2
    else:
        B *=2
    
if A< B and B<C:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input().split()
A = int(s[0])
B = int(s[1])
C = int(s[2])
K = int(input())

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

b = A < B < C

print('Yes' if b else 'No')

Solution (Python):
X = list(map(int, input().split()))
K = int(input())
flg = False;
for i in range(K):
    if X[0] < X[1]*2**i & X[1]*2**i < X[2]*2**(K-i):
        flg = True;
if flg:
    print('Yes')
else:
    print('No')

Solution (Python):
import sys

def check(r,g,b):
    return r<g and g<b

r,g,b=input().split()
r,g,b=int(r),int(g),int(b)

K=int(input())+1



for i in range(K):
    for j in range(K-i):
        for k in range(K-i-j):
            if check(r*2**(i),g*2**(j),b*2**(k)):
                print("Yes")
                sys.exit(0)
print("No")

Solution (Python):
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:
        break

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

Solution (Python):
li = list(map(int,input().split()))
k=int(input())

cnt=0
while li[0]>=li[1]:
  li[1]*=2
  cnt+=1

while li[1]>=li[2]:
  li[2]=2*li[2]
  cnt+=1 

if cnt<=k:
  print("Yes")
elif cnt>k:
  print("No")

Solution (Python):
import sys
sys.setrecursionlimit(20000)
def solve(a, b, c, k):
    if(a < b and b < c and k>=0):
        return "Yes"
    elif(k < 0):
        return "No"
    s1 = solve(a, 2*b, c, k-1)
    s2 = solve(a, b, 2*c, k-1)
    if(s1 == "Yes" or s2 == "Yes"):
        return "Yes"
    else:
        return "No"

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

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())
k = 0
ans = 'Yes'
while k <= K and (B <= A or C <= B):
    if B <= A:
        B *= 2
    elif C <= B:
        C *= 2
    if k == K:
        ans = 'No'
    k += 1
print(ans)

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

ans = "No"
def f(a, b, c, cnt, k):
    global ans
    if cnt > k:
        return
    if b > a and c > b:
        ans = "Yes"
        return
    
    f(2*a, b, c, cnt+1, k)
    f(a, 2*b, c, cnt+1, k)
    f(a, b, 2*c, cnt+1, k)


f(A, B, C, 0, K)
print(ans)

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


d=a//b//2


if not b*2**d>a:
    d+=1
b=b*2**d

e=b//c//2
if not c*2**e>b:
    e+=1

if k>=d+e:
    print("Yes")
else:
    print("No")

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

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

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

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

Solution (Python):
a = list(map(int, input().split()))
b = int(input())

t = 0
s = 0
while a[1] <= a[0]:
    a[1] = a[1] * 2
    t = t + 1
while a[2] <= a[1]:
    a[2] = a[2] * 2
    s = s + 1

if t+s <=b:
    print("Yes")
else:
    print("No")

Solution (Python):
from itertools import combinations_with_replacement
import copy

def main(lst, K):
    original = copy.copy(lst)
    
    comb = combinations_with_replacement([0, 1, 2], K)
    for c in comb:
        lst = copy.copy(original)
        for i in c:
            lst[i] *= 2
            if lst[0] < lst[1] and lst[1] < lst[2]:
                print('Yes')
                exit()
    print('No')

if __name__ == '__main__':
    lst = list(map(int, input().split()))
    K = int(input())
    main(lst, K)

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

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

if b>a and c> b:
    print("Yes")
    exit()

for i in range(k+1):
    if b*2**i > a and c*2**(k-i) > b*2**i:
        print("Yes")
        exit()

print("No")

Solution (Python):
import sys
import copy
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
INF = 1000000000000

a = LI()
k = I()

m = pow(3,k)
result = False
for i in range(m):
    val = copy.copy(a)
    for _ in range(k):
        tmp = i % 3
        i = i // 3
        val[tmp] = val[tmp]*2
    
    if(val[1] > val[0] and val[2] > val[1]):
        result = True

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

Solution (Python):
def magic_2():
    R, G, B = map(int, input().split())
    K = int(input())

    if isSucess(R, G, B):
        print('Yes')
        return

    for _ in range(K):

        if B <= G or B <= R:
            B *= 2
        elif G <= R:
            G *= 2

    if isSucess(R, G, B):
        print('Yes')
    else:
        print('No')


def isSucess(R, G, B):
    if B > G > R:
        return True
    else:
        return False


def main():
    magic_2()


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    A, B, C = map(int, input().split())
    K = int(input())

    for i in range(K):
        if A < B < C:
            print("Yes")
            exit()

        if A >= B:
            B *= 2
        elif B >= C:
            C *= 2

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


if __name__ == '__main__':
    main()

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

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

Solution (Python):
red, green, blue = map(int, input().split())
k = int(input())
for i in range(k):
    if red >= green:
        green *= 2
    else:
        blue *= 2
if red < green and green < blue:
    print("Yes")
else:
    print("No")

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

ans = 'No'
if A < B < C:
    ans = 'Yes'

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

if B < C and res <= K:
    ans = 'Yes'

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

if res <= K:
    ans = 'Yes'

print(ans)

Solution (Python):
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

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

Solution (Python):
import sys
import numpy as np
input = sys.stdin.readline


def log(*args):
    print(*args, file=sys.stderr)


def main():
    np.set_printoptions(threshold=20)
    A, B, C = map(int, input().rstrip().split())
    K = int(input())
    
    while A >= B:
        B *= 2
        K -= 1
    while B >= C:
        C *= 2
        K -= 1
    if K >= 0:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Solution (Python):
import sys

def Ss():
  return sys.stdin.readline().rstrip().split(' ')

def Is():
  ss = Ss()
  return map(int, ss) if len(ss) > 1 else int(ss[0])

a, b, c = Is()
k = Is()

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

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

Solution (Python):
a,b,c=map(int,input().split())
l=int(input())

for i in range(l+1):
    a2=a*2**i
    for j in range(l+1):
        b2=b*2**j
        for k in range(l+1):
            c2=c*2**k
            if i+j+k==l and b2>a2 and c2>b2:
                print("Yes")


                exit()
print("No")

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

for i in range(k + 1):
    for j in range(k + 1 - i):
        for l in range(k + 1 - i - j):
            if c * 2 ** l > b * 2 ** j > a * 2 ** i:
                print('Yes')
                exit()

print('No')

Solution (Python):

a, b, c = (int(x) for x in input().split())
k = int(input())

ans = 'No'

for i in range(k):

    if c <= b : 
        c = c * 2
    else :
        if b <= a :
            b = b * 2

    
    
    

    if a < b < c :
        ans = 'Yes'
        break

print(ans)

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

flag=0
for i in range(0, k+1):
  bb = b * (2**i)
  j = k-i
  cc = c * (2**j)
  if (a < bb) and (bb < cc):
    print('Yes')
    flag=1
    break

if flag==0:
  print('No')

Solution (Python):
[a, b, c] = [int(x) for x in input().split()]
k = int(input())















if c > b and b > a:
    print('Yes')

else:
    while b <= a and k > 0:
        b *= 2
        k -= 1

    if k < 0 and not(c > b and b > a):
        print('No')

    if c > b and b > a and k >= 0:
        print('Yes')

    else:
        while c <= b and k > 0:
            c *= 2
            k -= 1

        if k < 0 and not(c > b and b > a):
            print('No')

        if c > b and b > a and k >= 0:
            print('Yes')

        else:
            print('No')

Solution (Python):
def INT():
    return int(input())

def MI():
    return map(int, input().split())

def LI():
    return list(map(int, input().split()))

A, B, C = MI()
K = INT()

for i in range(K):
    if A >= B:
        B *= 2
        continue
    if B >= C:
        C *= 2
        continue
print("Yes" if B > A and C > B else "No")

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

count = 0
while not A < B:
  B *= 2
  count += 1
while not B < C:
  C *= 2
  count += 1

if count <= K and A < B < C:
  print('Yes')
else:
  print('No')

Solution (Python):
def main():
    A,B,C=map(int,input().split())
    K=int(input())
    cnt = 0
    for b in range(10):
        if A >= B:
            cnt += 1
            B *= 2
    for c in range(10):
        if B >= C:
            cnt += 1
            C *= 2
    if cnt <= K:
        print('Yes')
    else:
        print('No')
main()

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

ans = "No"

def ABC(int1, int2, int3):
    if int1 < int2 < int3:
        return True
    else:
        return False

if ABC(A, B, C):
    ans = "Yes"
else:
    for k in range(K):
        if B <= A:
            B = B * 2
        elif C <= B:
            C = C * 2
        
        if ABC(A, B, C):
            ans = "Yes"
            break

print(ans)

Solution (Python):
from itertools import combinations_with_replacement
A, B, C = map(int, input().split())
K = int(input())
ans = 0
for comb in combinations_with_replacement([0, 1, 2], K):
  judge = [A, B, C]
  for i in comb:
    judge[i] *= 2
  
  if judge[2] > judge[1] and judge[1] > judge[0]:
    print('Yes')
    ans += 1
    break
if ans == 0:
  print('No')

Solution (Python):
a,b,c=map(int,input().split())
k=int(input())
s=0
for i in range(10):
    if b*(2**i)>a:
        s=i
        break
b*=2**s
t=0
for i in range(10):
    if c*(2**i)>b:
        t=i
        break
if s+t>k:
    print("No")
else:
    print("Yes")

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

for i in range(K):
  if A < B < C:
    break
  elif A >= B:
    B = B * 2
  elif B >= C:
    C = C * 2
    
if A < B < C:
  print('Yes')
else:
  print('No')

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

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

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

Solution (Python):
from itertools import product

RGB0 = [*map(int, input().split())]
K = int(input())

for K_cards in product(range(3), repeat=K):
  RGB = RGB0[:]
  if RGB[2] > RGB[1] > RGB[0]:
    print("Yes")
    exit()
  for i in range(K):
    RGB[K_cards[i]] *= 2
    if RGB[2] > RGB[1] > RGB[0]:
      print("Yes")
      exit()
print("No")

Solution (Python):
def main():
    import sys
    def input():
        return sys.stdin.readline()[:-1]
    X=list(map(int,input().split()))
    A=X[0]
    B=X[1]
    C=X[2]
    K=int(input())
    for i in range(K):
        if A<B and B<C:
            print("Yes")
            sys.exit()
        if C<=A or C<=B:
            C=2*C
        else:
            B=2*B
    if A<B and B<C:
        print("Yes")
        sys.exit()                
    print("No")
if __name__ == '__main__':
    main()

Solution (Python):
import sys
import math
from collections import defaultdict,deque
from itertools import permutations
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()
sys.setrecursionlimit(10**6)
"""========main code==============="""

t=1
for _ in range(t):
    a,b,c=ml()
    k=ii()
    ans="No"
    while(k and b<=a):
        b*=2
        k-=1
    while(k and c<=b):
        c*=2
        k-=1
    if(c>b and b>a):
        ans="Yes"
    print(ans)

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

A,B,C=map(int,input().split())
K=int(input())
while A>=B:
    B*=2
    K-=1
while B>=C:
    C*=2
    K-=1
YesNo(K>=0)

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

K = int(input())

cnt=0

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

Solution (Python):
A, B, C = list(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')

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

k=int(input())
i=1

c>b>a 
ans='No'
if c>b and b>a:
    ans='Yes'
else:
    while b<=a and i<=k:
        b=b*2
        i+=1

    while c<=b and i<=k:
        c=c*2
        i+=1
    if c>b and b>a:
        ans='Yes'
print(ans)

Solution (Python):
import sys
readline=sys.stdin.readline

A,B,C=map(int,readline().split())
K=int(readline())

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

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())
flag = 0
for trial in range(0, k+1):
    for red in range(0, trial+1):
        for green in range(0, trial+1-red):
            for blue in range(0, trial+1-red-green):
                new_num = [a * 2**red, b * 2**green, c * 2**blue]
                if new_num[1] > new_num[0] and new_num[2] > new_num[1]:
                    flag = 1
if flag == 0:
    print('No')
else:
    print('Yes')

Solution (Python):
import sys
a, b, c = map(int, input().split())
k = int(input())
for i in range(k):
  if a < b and b < c:
    print('Yes')
    sys.exit()
  if a >= b:
    b *= 2
  else:
    c *= 2
if a < b and b < c:
  print('Yes')
else:
  print('No')

Solution (Python):


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

for i in range(0,K):
    if (A >= B):
        B *= 2
        continue

    if (B >= C):
        C *= 2
        continue

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

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

Solution (Python):
red, green, blue = map(int, input().split())
K = int(input())

for i in range(K):
    if (green <= red):
        green *= 2
    elif (blue <= green):
        blue *= 2

if (red < green and green < blue):
    print('Yes')
else:
    print('No')

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

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

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

Solution (Python):
[A, B, C] = list(map(int, input().split()))
K = int(input())
N = 0
Answer = 'No'

while B <= A:
    B = 2*B
    N += 1

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

if N <= K:
    Answer = 'Yes'
print(Answer)

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

flag = False
for i in range(0, K):
    a = A*2**i
    for j in range(0, K-i):
        b = B*2**j
        c = C*2**(K-i-j)
        if a < b < c:
            flag = True
            
            break
    if flag:
        break
if flag:
    print('Yes')
else:
    print('No')

Solution (Python):
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")

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

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

Solution (Python):
a,b,c = map(int, input().split())
k = int(input())
 
for i in range(k):
    if b<=a:
        b*=2
    elif c<=b:
        c*=2

if c>b and b>a:
    print("Yes")
else:
    print("No")

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

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

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

Solution (Python):
import itertools
from copy import copy


def lr(abc):
    return


def check(abc, k):
    for i in range(K + 1):
        for v in itertools.combinations_with_replacement([0, 1, 2], i):
            ABC_ = copy(ABC)
            for j in v:
                ABC_[j] *= 2
            if ABC_[0] < ABC_[1] < ABC_[2]:
                return "Yes"
    return "No"


ABC = list(map(int, input().split()))
K = int(input())

print(check(ABC, K))

Solution (Python):
a,b,c = map(int,input().split())
k = int(input())
for i in range(k):
  if a >= b:
    b *= 2
  elif b >= c:
    c *= 2

if c > b and b > a:
  print("Yes")
else:
  print("No")

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())
ans = 'Yes'

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

while b >= c:
    c *= 2
    k -= 1

if k < 0:
    ans = 'No'

print(ans)

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())
flag = 0
if A < B and B < C:
    flag = 1

for i in range(K):
    Bcp = B
    Ccp = C
    for j in range(i):
        Bcp *= 2
    for j in range(K-i):
        Ccp *= 2
    if A < Bcp and Bcp < Ccp:
        flag = 1
    
if flag == 1:
    print("Yes")
else:
    print("No")

Solution (Python):
li = list(map(int,input().split()))
a=int(input())
magic = 0
for i in range(0,8):
    if li[0] >= li[1]:
        li[1] = li[1] * 2
        magic = magic + 1

for i in range(0,8):
    if li[1] >= li[2]:
        li[2] = li[2] * 2
        magic = magic + 1
if a >= magic:
    print("Yes")
else:
    print("No")

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

for i in range(K):
    if A >= C:
        C *= 2
    elif A >= B:
        B *= 2
    elif B >= C:
        C *= 2
    if A < B and B < C:
        print("Yes")
        break
else:
    print("No")