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:
s = input().split()

A = int(s[0])
B = int(s[1])
C = int(s[2])

K = int(input())

result = False

for i in range(K+1):
  if A < B * (2 ** i):
    if (B * (2 ** i)) < C * (2 ** (K - i)):
      result = True
      break
    
if result:
  print('Yes')
else:
  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 = B * 2
    elif B >= C:
        C = C * 2

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

count = 0

while count <= k:
    if a < b and b < c:
        break
    if a >= b:
        count+=1
        b*=2
    elif b >= c:
        count+=1
        c*=2
if a < b and b < c and count <= k:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
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 b > a and c > b:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1,len(li)):
    while li[i] <= li[i-1] and k:
        li[i] = li[i]*2
        k-=1
for i in range(1,len(li)):
    if li[i] <= li[i-1]:
        print('No')
        break
else:
    print('Yes')

Submission status: Accepted

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

while(a[0] >= a[1]):
    a[1] *= 2
    b -= 1
    if b <= 0:
        break
while(a[1] >= a[2]):
    a[2] *= 2
    b -= 1
    if b <= 0:
        break
if a[0] < a[1] and a[1] < a[2] and b >= 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def main():
    a, b, c = map(int, input().split())
    k = int(input())
    cnt = 0
    while(1):
        # print(a)
        # print(b)
        # print(c)
        # print('------------------')
        if cnt-1 == k:
            print('No')
            return
        cnt += 1
        if a < b and b < c:
            print('Yes')
            return
        if not a < b:
            b = 2*b
        elif not b < c:
            c = 2*c
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

def main():
    R,G,B=map(int,input().split())
    K=int(input())

    #R<G<B
    res=0

    if G<=R:
        m=R/G
        n=int(math.log2(m))+1
        res+=n
        G=G*pow(2,n)
        if B<=G:
            m=G/B
            n=int(math.log2(m))+1
            res+=n
    elif B<=G:
        m=G/B
        n=int(math.log2(m))+1
        res+=n

    if res<=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())
cnt=0
while a>=b:
  b=b*2
  cnt+=1

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

Submission status: Accepted

Solution code:
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
import itertools
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

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

ans = False

def check(a,b,c):
    return a < b and b < c

for i in range(K):
    if A >= B:
        B = B * 2
    elif B >= C:
        C = C * 2
    if check(A,B,C):
        print("Yes")
        exit() 

print("No")

Submission status: Accepted

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

k = 0

for i in range(q+1):
    for j in range(0, q-i+1):
        B_ = B * (2 ** i)
        C_ = C * (2 ** j)
        if A < B_ and B_ < C_ and A < C_:
            k = 1
if k != 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
from sys import exit
import math
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

a,b,c = mi()
k=ii()

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

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

Submission status: Accepted

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

def main():
    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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
cards = [int(i) for i in input().split(" ")]

A = cards[0]
B = cards[1]
C = cards[2]

K = int(input())
beyondA = 0
beyondB = 0

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

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

if K < beyondA + beyondB:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
#!/usr/bin python3
# -*- coding: utf-8 -*-

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

from itertools import product
L = list(product(range(3), repeat=K))
for l in L:
    RGB=RGB_[:]
    for i in l:
        RGB[i] = RGB[i]*2
        if RGB[2]>RGB[1]>RGB[0]:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#for _ in range(int(input())):
a,b,c=map(int,input().split())
k=int(input())
f=0
if a<b<c:
  print('Yes')
  f=1
t=0
while(b<=a):
  b*=2
  t+=1
while(c<=b):
  c*=2
  t+=1
if t<=k and f==0:
  print('Yes')
  f=1
if f==0:print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c = list(map(int, input().split()))
k = int(input())
 
ans = False
 
for i in range(k):
    if c <= b:
        c *= 2
    elif b <= a:
        b *= 2
    else:
        ans = True
        break
if c > b and b > a:
    ans = True

if ans:
  	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*b
  t +=1
while(b>=c):
  c = 2*c
  t +=1
if(t<=k):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
#b

# B > A
# C > B

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

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

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

Submission status: Accepted

Solution code:
R, G, B = map(int, input().strip().split(" "))
K = int(input())
k = 0
while (k < K):
    if (G <= R):
        G *= 2
    elif (B <= G):
        B *= 2
    k += 1
if (B > G and G > R):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
rl = sys.stdin.buffer.readline

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

b = 0
for k in range(K):
  if A < (B * (2 ** k)):
    b = k
    break

c = K - b
vb = B * (2 ** b)
vc = C * (2 ** c)

print('Yes' if A < vb and vb < vc else 'No')

Submission status: Accepted

Solution code:
R,G,B=map(int,input().split())
K=int(input())
cnt=0
while cnt<K:
    if R>=G:
        G*=2
        cnt+=1
    else:
        B*=2
        cnt+=1
if R<G<B:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:

def main():
    a,b,c = list(map(int, input().split()))
    k = int(input())
    
    for i in range (k):
        if b <= a:
            b = b*2
        elif c <= b:
            c = c*2
    
    if a < b and b < c:
        print("Yes")
    else:  
        print("No")
   
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def inN():
    return int(input())
def inL():
    return list(map(int,input().split()))
def inNL(n):
    return [input().split() for i in range(n)]
import math
a,b,c = inL()
k = inN()
for i in range(k):
    if a >= b:
        b *= 2
    else:
        if b>=c:
            c *= 2
#print(a,b,c)
if a < b and b < c :
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

if b <= a:
    while k > 0:
        b *= 2
        k -= 1
        if b > a:
            break

if c <= b:
    while k > 0:
        c *= 2
        k -= 1
        if c > b:
            break

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

Submission status: Accepted

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

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

if cnt > K:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
a,b,c=map(int,input().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')

Submission status: Accepted

Solution code:
import math
import collections
import bisect
from collections import deque
from copy import copy, deepcopy


def main():
    A, B, C = map(int, input().split())
    K = int(input())
    ans = 0
    tmp1 = math.ceil(math.log2((A + 0.1) / B))
    if tmp1 > 0:
        B = B * (2**tmp1)
        ans += tmp1
    tmp2 = math.ceil(math.log2((B + 0.1) / C))
    if tmp2 > 0:
        ans += tmp2
    #print(tmp1, tmp2)
    if ans <= 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 B <= A:
        B *= 2
    elif C <= B:
        C *= 2
    
    if A < B and B < C:
        break

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

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
k = int(input())
count = 0
for i in range(k):
    if b <= a:
        b = b * 2
        count += 1
    elif a < b and c <= b:
        c = c * 2
        count += 1
    if count == k:
        break

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

def solve(A, B, C, K):
    k = 0
    while A >= B:
        B *= 2
        k += 1
    while B >= C:
        C *= 2
        k += 1
    return "Yes" if k <= K else "No"


if __name__ == '__main__':
    inputs = read()
    print("%s" % solve(*inputs))

Submission status: Accepted

Solution code:
import sys

r, g, b = map(int, sys.stdin.readline().split())
k = int(sys.stdin.readline())

for i in range(k):
    if not r < g:
        g *= 2
    elif not g < b:
        b *= 2

if r < g and g < b:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

result = 0

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

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

Submission status: Accepted

Solution code:
import os
import heapq
import sys
import math
import bisect
import operator
from collections import defaultdict
from io import BytesIO, IOBase
def gcd(a,b):
    if b==0:

        return a
    else:
        return gcd(b,a%b)
def power(x, p,m):
    res = 1
    while p:
        if p & 1:
            res = (res * x) % m
        x = (x * x) % m
        p >>= 1
    return res
def inar():
    return [int(k) for k in input().split()]


# def bubbleSort(arr,b):
#     n = len(arr)
#     for i in range(n):
#         for j in range(0, n - i - 1):
#             if arr[j] > arr[j + 1] and b[j]!=b[j+1]:
#                 arr[j], arr[j + 1] = arr[j + 1], arr[j]
#                 b[j],b[j+1]=b[j+1],b[j]
def lcm(num1,num2):
    return (num1*num2)//gcd(num1,num2)

def main():
    #for _ in range(int(input())):
    #n=int(input())
    a,b,c=map(int,input().split())
    k=int(input())
    counter=0
    while 1:
        if a<b<c or k==0:
            break
        if a>=b and k>0:
            b=b*2
            k-=1
            continue
        if b>=c and k>0:
            c=c*2
            k-=1
            continue
    if a<b<c:
        print("Yes")
    else:
        print("No")













BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
import math
sys.setrecursionlimit(int(1e6))

a, b, c = list(map(int, input().split()))
k = int(input())
#print('a, b, c = ', a, b, c)
#print('k = ', k)

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

  if (b > a):
    c = 2 * c
  else:
    b = 2 * b

  k = k - 1
else:
  if (b > a) and (c > b):
    print('Yes')
  else:
    print('No')

#print('a, b, c = ', a, b, c)
#print('k = ', k)

Submission status: Accepted

Solution code:

if __name__ == "__main__":
    A, B, C = map(int, input().split())
    K = int(input())

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

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

Submission status: Accepted

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

ans='No'
for k in range(K+1):
    k_b=k
    k_c=K-k
    
    if A < B*(2**k_b) and B*(2**k_b) < C*(2**k_c):
        ans='Yes'
    
print(ans)

Submission status: Accepted

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

for ai in range(k):
  for bi in range(k):
    if ai + bi > k:
      continue
    ci = k - (ai+bi)
    tmpa = a * (2 ** ai)
    tmpb = b * (2 ** bi)
    tmpc = c * (2 ** ci)
    if tmpa < tmpb and tmpb < tmpc:
      print('Yes')
      exit(0)
print('No')

Submission status: Accepted

Solution code:
import copy
import itertools
r,g, b = map(int,input().split())
k = int(input())
#hl = list(map(int,input().split()))

lst = [r,g,b]
for v in itertools.product([0,1,2], repeat=k):
    tmplst = copy.deepcopy(lst)
    for i in v:
        tmplst[i] *= 2
    if tmplst[0] < tmplst[1] < tmplst[2]:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

Solution code:
import sys
#import string
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def solve():
    A, B, C = map(int, stdin.readline().rstrip().split())
    k = int(stdin.readline().rstrip())
    for i in range(k):
        if C > B > A:
            print("Yes")
            exit()
        elif B >= C or A >= C:
            C = C*2
        elif A >= B:
            B = B*2
    if C > B >A:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:

def main():
    A, B, C = (int(x) for x in input().split(" "))
    K = int(input())
    for i in range(K):
        if A < B:
            if B < C:
                print("Yes")
                exit()
            C = 2*C
        else:
            B = 2*B

    if A < B and B < C:
        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
	elif b >= c:
		c *= 2

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

Submission status: Accepted

Solution code:
A, B, C = map(lambda x:int(x), input().split(' '))
K = int(input())
count = 0
while count < K:
    if A >= B:
        B *= 2
        count+=1
    elif B >= C:
        C *= 2
        count+=1
    else:
        break
if A < B < C:
    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:
    B *= 2
    cnt += 1
# print(A, B, C)
while B >= C:
    C *= 2
    cnt += 1
# print(A, B, C, cnt)
if cnt <= K:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

while(K > 0 and A >= B):
    K-=1
    B = B*2


while(K > 0 and B >= C):
    K-=1
    C = C*2

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import itertools
x=list(map(int,input().split()))
k=int(input())
L=list(itertools.combinations_with_replacement([0,1,2],k))
for l in L:
    X=x.copy()
    for i in l:
        X[i] = X[i]*2
    if X[0]<X[1] and X[1]<X[2]:
        print("Yes")
        break
else:
    print("No")

Submission status: Accepted

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

for i in range(k+1):
    mb = b * (2 ** i)
    if a < mb:
        r = k -i
        for j in range(r + 1):
            mc = c * (2 ** j)
            if mb < mc:
                print('Yes')
                t = 1
                break
        break

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

Submission status: Accepted

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


# 入力を整数に変換して受け取る
def input_int():
    return int(input())


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return map(int, input().split())


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


import itertools
def main():
    a, b, c = input_to_int_map()
    k = input_int()

    for temp in itertools.product(range(3), repeat=k):
        red = a
        green = b
        blue = c

        if red < green < blue:
            return "Yes"

        for i in temp:
            if i == 0:
                red *= 2
            elif i == 1:
                green *= 2
            elif i == 2:
                blue *= 2

            if red < green < blue:
                return "Yes"

    return "No"


if __name__ == "__main__":
    print(main())

Submission status: Accepted

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

else:
    cnt = 0
    while(b <= a):
        cnt = cnt+1
        b = b*2

if c <= b:
    while(c <= b):
        cnt = cnt+1
        c = c*2

if cnt <= k:
    print("Yes")

else:
    print("No")

Submission status: Accepted

Solution code:
A, B, C = [int(s) for s in input().split()]
K = int(input())
cnt = 0
if B <= A:
    while (B <= A):
        B *= 2
        cnt += 1

if C <= B:
    while (C <= B):
        C *= 2
        cnt += 1

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

Submission status: Accepted

Solution code:
r,g,b=map(int,input().split())
k=int(input())
cnt=0
while(True):
    #print(r,g,b)
    if(g>r and b>g):
        break
    else:
        if(g<=r):
            g=g*2
            cnt+=1
        else:
            if(b<=g):
                b=b*2
                cnt+=1
if(cnt<=k):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
"""    Arnab Chanda    """

from collections import defaultdict, deque
from itertools import permutations
from sys import stdin,stdout
from bisect import bisect_left, bisect_right
from copy import deepcopy
import heapq

int_input=lambda : int(stdin.readline())
string_input=lambda : stdin.readline().split()
multi_int_input =lambda : map(int, stdin.readline().split())
multi_input = lambda : stdin.readline().split()
list_input=lambda : list(map(int,stdin.readline().split()))
string_list_input=lambda: list(string_input())
MOD = pow(10,9)+7


a,b,c = multi_int_input()
ki = int_input()
flag = 0

for i in range(ki+1):
    for j in range(ki+1):
        for k in range(ki+1):
            # print(i,j,k)
            if ((i+j+k) <= ki):
                # print(i, j, k, c*pow(2,k), b*pow(2,j), a*pow(2,i))
                if ((c*pow(2,k) > b*pow(2,j)) and (b*pow(2,j) > a*pow(2,i))):
                    flag  = 1

if flag == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(A: int, B: int, C: int, K: int):
    flag = False
    for k1 in range(K+1):
        for k2 in range(K+1):
            for k3 in range(K+1):
                if not k1 + k2 + k3 <= K:
                    break
                if B * (2 ** k2) > A * (2 ** k1) and C * (2 ** k3) > B * (2 ** k2):
                    flag = True

    if flag == True:
        print(YES)
    else:
        print(NO)
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(A, B, C, K)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
	return list(map(int,input().split()))
def m(): #複数文字
	return map(int,input().split())
def onem(): #Nとかの取得
	return int(input())
def s(x): #圧縮
	a = []
	if len(x) == 0:
		return []
	aa = x[0]
	su = 1
	for i in range(len(x)-1):
		if aa != x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a
def jo(x): #listをスペースごとに分ける
	return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
	return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
	ll = 0
	rr = r
	while True:
		mid = (ll+rr)//2

	if rr == mid:
		return ll
	if (ここに評価入れる):
		rr = mid
	else:
		ll = mid+1
"""

a,b,c = m()

k = onem()

po = cl.deque([[a,b,c,k]])
final = []
while len(po) != 0:
	a,b,c,k = po.popleft()
	if k == 0:
		final.append([a,b,c])
		continue
	po.append([a*2,b,c,k-1])
	po.append([a,b*2,c,k-1])
	po.append([a,b,c*2,k-1])
for i in range(len(final)):
	if final[i][0] < final[i][1] and final[i][1] < final[i][2]:
		print("Yes")
		exit()
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
        continue
    if(B>=C):
        C *= 2
if(B>A and C>B):
     print("Yes")
else:
     print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict,deque
import math
def gcd(a,b):
    return b if not a%b else gcd(b,a%b)
def lcm(a,b):
    return (a*b)//gcd(a,b)

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

    cnt = 0
    while(cnt<k):
        if(c<=b):
            c*=2
            cnt+=1
        elif(b<=a):
            b*=2
            cnt+=1
        else:
            cnt+=1

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a,b,c=[int(x) for x in input().split()]
k=int(input())
while k > 0 and a>=b:
  b*=2
  k-=1
while k>0 and b>=c:
  c*=2
  k-=1
if a<b and b<c:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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


print(status)

Submission status: Accepted

Solution code:
def main():
	a,b,c = map(int,input().split())
	k = int(input())
	judge = True
	counter = 0
	while judge:
		if a < b < c:
			print("Yes")
			break
		else:
			counter += 1
		if counter <= k:
			if a >= b:
				b *= 2
			elif b >= c:
				c *= 2
		else:
			print("No")
			break

			

if __name__ == '__main__':
	main()

Submission status: Accepted

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

cnt = 0
for _ in range(k+1):
    if b <= a:
        b *= 2
        cnt += 1
    else:
        break
        
for _ in range(k+1):
    if c <= b:
        c *= 2
        cnt += 1
    else:
        break
        
        
if cnt > k:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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