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

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

Submission status: Accepted

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

while A >= B:
    B = B*2
    count = count + 1
    
for i in range(K - count):
    C = C * 2

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
k = int(input())
for new_k in range(k + 1):
    for t in range(3 ** new_k):
        na = a
        nb = b
        nc = c
        nt = t
        for x in range(new_k):
            if nt % 3 == 0:
                na *= 2
            elif nt % 3 == 1:
                nb *= 2
            else:
                nc *= 2

            if na < nb < nc:
                print("Yes")
                quit(0)
            nt //= 3
print("No")

Submission status: Accepted

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

c = 0
while A >= B:
    B *= 2
    c += 1
    if c > K:
        print('No')
        quit()

while B >= C:
    C *= 2
    c += 1
    if c > K:
        print('No')
        quit()

print('Yes')

Submission status: Accepted

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

for i in range(0,k):
        if a >= b:
                b *= 2
        elif b >= c:
                c *= 2
        else:
                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())

ans="No"
for i in range(k+1):
  if a<b<c:
    ans="Yes"
  else:
    if a>=b:
      b*=2
    elif b>=c:
      c*=2


print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
cards = list(map(int,input().split()))
K = int(input())
for i in range(K):
    if cards[1]<=cards[0]:
        cards[1]*=2
        
    elif cards[2]<=cards[1]:
        cards[2]*=2
        
    else:
        break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = [int(i) for i in input().split()]
K = int(input())

for _ in range(K):
    if n[0] >= n[1]:
        n[1] = n[1] * 2
    else:
        n[2] = 2*n[2]
        

if n[2] > n[1] > n[0]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n):
    res = [None] * n
    for i in range(n):
        res[i] = II()
    return res
def LIR(n):
    res = [None] * n
    for i in range(n):
        res[i] = LI()
    return res
def FR(n):
    res = [None] * n
    for i in range(n):
        res[i] = IF()
    return res
def LIR(n):
    res = [None] * n
    for i in range(n):
        res[i] = IF()
    return res
def LIR_(n):
    res = [None] * n
    for i in range(n):
        res[i] = LI_()
    return res
def SR(n):
    res = [None] * n
    for i in range(n):
        res[i] = S()
    return res
def LSR(n):
    res = [None] * n
    for i in range(n):
        res[i] = LS()
    return res
mod = 1000000007
inf = float('INF')

#solve
def solve():
    a, b, c = LI()
    k = II()
    tmp = 0
    while a >= b:
        b *= 2
        tmp += 1
    while b >= c:
        c *= 2
        tmp += 1
    print("Yes" if tmp <= k else "No")
    return


#main
if __name__ == '__main__':
    solve()

Submission status: Accepted

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

for i in range(0,K+1):
    for j in range(0,K+1-i):
        for k in range(0,K+1-i-j):
            #print('{},{},{}'.format(i,j,k))
            if(A*(2**i) < B*(2**j) and B*(2**j) < C*(2**k)):
                if(i==j==k==0):
                    pass
                else:
                    print('Yes')
                    exit()

print('No')

Submission status: Accepted

Solution code:
import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    a, b, c = map(int, input().split())
    k = int(input())
    n = 0
    while a >= b:
        b <<= 1
        n += 1
    while b >= c:
        c <<= 1
        n += 1
    print("Yes" if n <= k else "No")
resolve()

Submission status: Accepted

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

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

print("Yes" if n>=0 else "No")

Submission status: Accepted

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

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

    if a < b < c:
        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())

ans = 'No'
i = 0
for i in range(K+1):
    for j in range(K+1-i):
        h = K-i-j 
        if i > 0 :
            R = A*(2**i)
        else:
            R = A
        if j > 0 :
            G = B*(2**j)
        else :
            G = B
        if h > 0 :           
            Bl = C*(2**h)
        else:
            Bl = C
        if G > R and Bl > G:
            ans = 'Yes'


print(ans)

Submission status: Accepted

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

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

if A < 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(0,K+1):
    for j in range(0,K+1):
        for h in range(0,K+1):
            if A*(2**i)<B*(2**j)<C*(2**h) and (i+j+h)<=K:
                print("Yes")
                exit()
print("No")

Submission status: Accepted

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

for i in range(0,k+1):
    if i == 0:
        cc = c
    else:
        cc = c*(2**i)
    
    if k-i == 0:
        bb = b
    else:
        bb = b*(2**(k-i))
    
    if cc > bb and bb > a:
        key = 1
        break

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

Submission status: Accepted

Solution code:
a,b,c,k=map(int,open(0).read().split())
while a>=b:b+=b;k-=1
while b>=c:c+=c;k-=1
print('YNeos'[k<0::2])

Submission status: Accepted

Solution code:
import sys
r,g,b = map(int,input().split())
k = int(input())
#青＞緑＞赤
count = 0
if g*(2**k)>r:
    while g<=r:
        g*=2
        count += 1
else:
    print("No")
    sys.exit(0)

if b*(2**(k-count))>g:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())

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

a = 0  # 魔術を行った回数
while B <= A:
    B *= 2
    a += 1
while C <= B:
    C *= 2
    a += 1

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

Submission status: Accepted

Solution code:
import sys


def resolve():
    readline = sys.stdin.readline

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

    for i in range(K + 1):
        len_j = K - i
        if len_j > 0:
            for j in range(len_j + 1):
                len_k = len_j - j
                if len_k > 0:
                    for k in range(len_k + 1):
                        a = A * 2 ** i
                        b = B * 2 ** j
                        c = C * 2 ** k
                        if a < b < c:
                            print('Yes')
                            exit()
    print('No')


resolve()

Submission status: Accepted

Solution code:
a,b,c,k=map(int,open(0).read().split())
while a>=b:b*=2;k-=1
while b>=c:c*=2;k-=1
print('YNeos'[k<0::2])

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
k=int(input())
if a<b:
    if b<c:
        print('Yes')
    else:
        count=0
        while b>=c:
            c*=2
            count+=1
        if count<=k:
            print('Yes')
        else:
            print('No')
else:
    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:
import math
A, B, C = map(int, input().split())
K = int(input())
x = 0
if A < B < C:
  print("Yes")
if A >= B:
  x = math.ceil(math.log(A/B, 2))
  B =B*(2**x)
  if A != B:
    if x > K:
      print("No")
    elif B < C:
      print("Yes")
  else:
    x += 1
    B = B*2
if B >= C:
  y = math.ceil(math.log(B/C, 2))
  C = C*(2**y)
  if B != C:
    if x+y > K:
      print("No")
    else:
      print("Yes")
  else:
    y += 1
    if x+y > K:
      print("No")
    else:
      print("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("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

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

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

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    A, B, C = map(int, rl().split())
    K = int(rl())
    
    while K:
        if A < B:
            break
        B *= 2
        K -= 1
    while K:
        if B < C:
            break
        C *= 2
        K -= 1
    
    print('Yes' if A < B < C else 'No')


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

for i in range(0,K+1):
    for j in range(0,K+1-i):
        for k in range(0,K+1-i-j):
            #print('{},{},{}'.format(i,j,k))
            if(A*(2**i) < B*(2**j) and B*(2**j) < C*(2**k)):

                print('Yes')
                exit()

print('No')

Submission status: Accepted

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

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

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

if k < 0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
x = input()
k = int(input())
x = x.split()
y = [int(s) for s in x]
dict = {"red":0, "green":0}
dict["red"] = y[0]
dict["green"] = y[1]
count = 0
if dict["red"] < dict["green"]:
      pass
else:
  for N in range(k):
    count += 1
    dict["green"] = dict["green"] * 2
    if dict["red"] < dict["green"]:
        break
    else:
        continue
dict["blue"] = y[2]
if k - count == 0:
  if dict["green"] > dict["blue"]:
    pass
  else:
    print("Yes")
    exit()
else:
  pass
i = k - count
if dict["green"] < dict["blue"]:
  print("Yes")
  exit()
else:
  for N in range(i):
    dict["blue"] = dict["blue"] * 2
    if dict["green"] < dict["blue"]:
      print("Yes")
      exit()
    else:
        continue
print("No")

Submission status: Accepted

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

k = int(input())

ans = 0

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

Submission status: Accepted

Solution code:
a,b,c=map(int, input().split())
d=int(input())
ans="No"
k=0
for i in range(d+1):
    b2=b*(2**(d-k))
    c2=c*(2**(k))
    if(a<b2<c2):
        ans="Yes"
    k+=1
print(ans)

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

if cnt > k:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
aa, bb, cc = a, b, c
p = 0
q = 1
k = int(input())

for i in range(1,k + 2):
    a, b, c = aa, bb, cc
    b = b * (2 ** (k - i + 1))
    c = c * (2 ** (i - 1))
    if c <= 0:
        c = cc
    if b <= 0:
        b = bb
    if a < b and b < c:
        p += 1

if p != 0:
    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")
else:
    for i 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:
a,b,c=map(int,input().split())
k=int(input())

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

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

Submission status: Accepted

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

    
  
for i in range(K+1):
  num = K-i
  for j in range(num+1):
    num2 = num-j
    if A*2**i<B*2**j:
      if B*2**j<C*2**num2:
        print("Yes")
        flag = False
        break
  if flag ==False:
    break
        
if flag == True:
  print('No')

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

a,b,c = map(int,readline().split())
k = int(readline())
ct = 0
while a >= b:
    b*= 2
    ct += 1

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

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

Submission status: Accepted

Solution code:
def solve():
    A,B,C=map(int,input().split())
    K=int(input())
    flag=False
    for i in range(0,K+1):
        for j in range(0,K-i+1):
            for k in range(0,K-i-j+1):
                if 2**i*A<2**j*B<2**k*C:
                    flag=True
                    break
    if flag:
        print("Yes")
    else:
        print("No")
if __name__=="__main__":
    solve()

Submission status: Accepted

Solution code:
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

if a<b and b<c and i<=k:
    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 b <= a:
        b *= 2
    elif c <= b:
        c *= 2

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

Submission status: Accepted

Solution code:
#: Author - Soumya Saurav
import sys,io,os,time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect,math,heapq
alphabet = "abcdefghijklmnopqrstuvwxyz"

input = sys.stdin.readline

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


def f(a,b,c,k):
	if k < 0:
		return False
	if a < b < c:
		return True
	ll = False
	ll |= f(a*2,b,c,k-1)
	ll |= f(a,b*2,c,k-1)
	ll |= f(a,b,c*2,k-1)
	return ll
if f(a,b,c,k):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
import sys
A, B, C = map(int,input().split())
k = int(input())
count=0
for i in range(k):
    if A>=B:
        count+=1
        B=B*2
    if B>=C:
        count+=1
        C=C*2

if count>k or not(B<C and A<B):
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
A, B, C = [int(n) for n in input().split()]
K = int(input())
ans = 'No'
for i in range(K+1):
    for j in range(K+1):
        if A < B<<i < C<<j and i+j<=K:
            ans = 'Yes'
            break
print(ans)

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())#赤midoriao
k = int(input())
#赤＜緑＜青
if (a < b) and (b<c):
  print("Yes")
else:
  while (a>=b) and (k>0):
    b = b*2
    k-=1
  #print(b)
  #print(k)
  while (b>=c) and (k>0):
    c = c*2
    k-=1
  #print(c)
  #print(k)
#print(a,b,c,k)
  if (a < b) and (b<c) and (k>=0):
    print("Yes")
  else:
    print("No")

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:

def Msol_B_():
    a,b,c = list(map(int,input().split()))
    K = int(input())

    for i in range(8):
        if K==0:
            print('No')
            return 
        if a >= b:
            b *= 2
            K -= 1
        if a < b:
            break
    for i in range(8):
        if  K ==0:
            print('No')
            return
        if b >= c:
            c *= 2
            K -= 1
        if b < c:
            print('Yes')
            return
    print('No')



Msol_B_()

Submission status: Accepted

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

for k in range(K):
    b = K - k
    g = k

    if A < B * 2 ** g < C * 2 ** b:
        print("Yes")
        exit()
else:
    print("No")

Submission status: Accepted

Solution code:
X = list(map(int,input().split()))
A = X[0]
B = X[1]
C = X[2]
K = int(input())
cnt = 0
if A >= B:
  for i in range(7):
   B = B*2
   cnt = cnt + 1
   if A < B:
    break
if B >= C:
  for j in range(7):
   C = C*2
   cnt = cnt + 1
   if B < C:
    break
if cnt <= K:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import math
r, g, b = [int(k) for k in input().split()]
k = int(input())
i = 0
while True:
    if b <= g or b <= r:
        b *= 2
    elif g <= r:
        g *= 2
    i += 1
    if i <= k:
        if b > g > r:
            print('Yes')
            break
    else:
        print('No')
        break

Submission status: Accepted

Solution code:
import itertools
import sys
input1 = list(map(int, input().split()))
input_A = input1[0]
input_B = input1[1]
input_C = input1[2]
K = int(input())

def check(r, g, b):
    if g > r and b > g:
        return True
    else:
        return False

def magic(card):
    return card * 2

mylist = [0, 1, 2]
for cards in itertools.product(mylist, repeat=K):
    A = input_A
    B = input_B
    C = input_C
    for itr in cards:
        if itr == 0:
            A = magic(A)
        elif itr == 1:
            B = magic(B)
        elif itr == 2:
            C = magic(C)
        if(check(A, B, C)):
            print('Yes')
            sys.exit()
        # print(A, B, C)
print('No')

    # print(cards[2])

Submission status: Accepted

Solution code:
def main():
    a, b, c = map(int, input().split())
    k = int(input())
    for i in range(1, k+2):
        if a < b and b < c:
            print("Yes")
            return 0
        
        elif i == k+1:
            print("No")
            return 0

        elif c <= a or c <= b:
            c = c * 2

        elif b <= a:
            b = b * 2

main()

Submission status: Accepted

Solution code:
import math
A, B, C = list(map(int, input().split()))
K = int(input())
#A, B, C = [7, 6, 100]
#K = 3

i = max(math.ceil(math.log2((A+1)/B)),0)
K -= i
B = B * (2 ** i)
j = max(math.ceil(math.log2((B+1)/C)),0)
K -= j
C = C * (2 ** j)
if K >= 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

ans_list = []
def doble_calc(value, num):
    if num == 1:
        return value
    elif num == 2:
        return value*2
    elif num == 3:
        return value*2*2
    elif num == 4:
        return value*2*2*2
    elif num == 5:
        return value*2*2*2*2
    elif num == 6:
        return value*2*2*2*2*2
    elif num == 7:
        return value*2*2*2*2*2*2
    
for i in range(1, k+2):
    for j in range(1, k+2):
        for l in range(1, k+2):
            if i + j + l == k+3:
                red_calc = doble_calc(red, i)
                green_calc = doble_calc(green, j)
                blue_calc = doble_calc(blue, l)
                ans_list.append([red_calc, green_calc, blue_calc])
            
for i in ans_list:
    if i[0] < i[1] < i[2]:
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

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

n=0

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

Submission status: Accepted

Solution code:
A,B,C = map(int, input().split())
K = int(input())
count = 0
a = 0
while K >= 0:

    if (A < B * 2 ** K) and (B * 2 ** K < C * 2 ** a):
        count +=1
    K -=1
    a +=1

if count >= 1:
    print("Yes")
else: print("No")

Submission status: Accepted

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

m = 0
n = 0

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

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

if k >= m + n:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
A,B,C = [int(i) for i in input().split()]
K = int(input())
c = 0
while B <= A:
    B *= 2
    c += 1
i = 1
while C <= B:
    C *= 2
    c += 1
if c <= K:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

for i in range(K):
    if list[0]<list[1]<list[2]:
        break
    if list[1]>=list[2]:
        list[2]=2*list[2]
        continue
    elif list[0]>=list[1]:
        list[1]=2*list[1]

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

Submission status: Accepted

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

a = int(a)
b = int(b)
c = int(c)
l = []

if k == 1:
    if a < 2*b < c or a < b < 2*c:
        l.append('Yes')
    else:
        l.append('No')
elif a < b*(2**k) < c or a < b < c*(2**k):
    l.append('Yes')
else:
    for i in range(1, k):
        if a < b*(2**(k-i)) < c*(2**i):
            l.append('Yes')
            break
        else:
            l.append('No')

d = len(l)
print(l[d-1])

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
    else:
        if b>=c:
            c=c*2
        else:
            break

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

Submission status: Accepted

Solution code:
A, B, C = input().split()
A = int(A)
B = int(B)
C = int(C)
K = input()
K = int(K)
z = 0
while B <= A:
    B = B * 2
    z = z + 1
while C <= B:
    C = C * 2
    z = z + 1
if K < z:
    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):
    if a >= b:
        b *= 2
    else:
        c *= 2
if a < b < c:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
a,b,c,k=map(int,open(0).read().split())
n=0
while a>=b: b*=2; n+=1
while b>=c: c*=2; n+=1
print('YNeos'[n>k::2])

Submission status: Accepted

Solution code:
import math
A,B,C = map(int, input().split())
K = int(input())
if A > B:
  K1 = math.ceil(math.log(A/B,2))
  B = B * (2 ** K1)
  if A == B:
    B = B * 2
    K1 = K1 + 1
elif A == B:
  B = B * 2
  K1 = 1
else:
  K1 = 0

if B > C:
  K2 = math.ceil(math.log(B/C,2))
  C = C * (2 ** K2)
  if C == B:
    K2 = K2 + 1
elif B == C:
  K2= 1
else:
  K2= 0
  
if K1 + K2 <= K:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

ans = 'No'
while K >= 0:
    if A < B < C:
        ans = 'Yes'
        break
    if B >= C:
        C *= 2
    else:
        B *= 2
    K -= 1

print(ans)

Submission status: Accepted

Solution code:
x=3
A,B,C=(int(x) for x in input().split())
K=int(input())
j=0
if A>=(2**K)*B :
    print('No')
else :
    while A>=(2**j)*B :
        j+=1
    if (2**j)*B>=(2**(K-j))*C :
        print('No')
    else:
        print('Yes')

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
K = int(input())
a=0
for i in range(K+1):
  for j in range(K-i+1):
    for k in range(K-i-j+1):
      if i+j+k==K:
        A_, B_, C_ = A, B, C
        A_ = A*(2**i)
        B_ = B*(2**j)
        C_ = C*(2**k)
        if C_>B_>A_:
          print('Yes')
          a=1
          break
    if a==1:
      break
  if a==1:
    break

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

Submission status: Accepted

Solution code:
A, B, C = (int(x) for x in 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 = list(map(int, input().split()))
K = int(input())

c = 0
while A >= B:
    B *= 2
    c += 1
while B >= C:
    C *= 2
    c += 1

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

Submission status: Accepted

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

count = 0
flag = 1

while 1:
  if count > k:
    flag = 0
    break
  if b > a:
    break
  b = 2 * b
  count += 1
  

while 1:
  if count > k:
    flag = 0
  if c > b:
    break
  c = 2 * c
  count += 1
  
if flag == 0:
  print("No\n")
else:
  print("Yes\n")

Submission status: Accepted

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

for i in range(k):
    if card[0] >= card[1]:
        card[1] *= 2
    elif card[1] >= card[2]:
        card[2] *= 2
    else:
        card[2] *= 2

print("Yes") if card[0] < card[1] < card[2] else print("No")

Submission status: Accepted

Solution code:
lst = [int(i) for i in input().split()]
a = int(input())

n = []
if a == 1:
  for i in range(3):
    n.append([i])
if a == 2:
  for i in range(3):
    for j in range(3):
      n.append([i, j])
if a == 3:
  for i in range(3):
    for j in range(3):
      for k in range(3):
        n.append([i, j, k])
if a == 4:
  for i in range(3):
    for j in range(3):
      for k in range(3):
        for l in range(3):
          n.append([i, j, k, l])
if a == 5:
  for i in range(3):
    for j in range(3):
      for k in range(3):
        for l in range(3):
          for m in range(3):
            n.append([i, j, k, l, m])
if a == 6:
  for i in range(3):
    for j in range(3):
      for k in range(3):
        for l in range(3):
          for m in range(3):
            for o in range(3):
              n.append([i, j, k, l, m, o])
if a == 7:
  for i in range(3):
    for j in range(3):
      for k in range(3):
        for l in range(3):
          for m in range(3):
            for o in range(3):
              for p in range(3):
                n.append([i, j, k, l, m, o, p])
flag = False
for i in range(len(n)):
  #print(n[i])
  for index in n[i]:
    lst[index] *= 2
    #print(lst)
    if (lst[0] < lst[1]) and (lst[1] < lst[2]):
      flag = True
      break
  if flag:
    break
  for index in n[i]:
    lst[index] = int(lst[index] / 2)
if flag:
  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):
  if R > G:
    G*=2
  elif G > B:
    B*=2
  elif R > B:
    B*=2
  elif R == G == B:
    B *= 2
  elif R == G:
    G *= 2
  elif G == B:
    B *= 2
  else:
    pass
if R < G < B:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
k = int(input())
flag = False
for i in range(1,k+2):
    for j in range(1,k-i+3):
        for d in range(1,k-i-j+4):
            if (a*(2**(i-1)))<(b*(2**(j-1)))<(c*(2**(d-1))):
                flag = True
                
if flag == True:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

if a >= c:
  while k >= 1:
    c *= 2
    k -= 1
    if c > a:
      break

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

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