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 _ in range(K):
    if A >= B:
        B *= 2
    elif B >= C:
        C *= 2

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

Submission status: Accepted

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

for i in range(k+1):
    if b>a:
        if c>b:
            print('Yes')
            break
        else:
            c *= 2
    else:
        b *= 2
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
a, b, c = map(int, input().split())
k = int(input())
def two(num):
  for i in range(1,8):
    if (2**(i-1)<=num) & (num<2**(i)):
      return i
  return 0
ab = two(a/b)
b_ = b*2**ab
b_c = two(b_/c)

if k>=(ab+b_c):
  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)
for i in range(K):
    if B > C or C == B:
        C = C*2
    elif A > B or B == A:
        B = B*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 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:
def b():
    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
        else:
            print('Yes')
            return

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


##########
if __name__ == "__main__":
    b()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# N,M = map(int,sys.stdin.readline().split())
# a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
# a = tuple(int(sys.stdin.readline()) for _ in range(N)) # multi line with single param
# a = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param
# s = sys.stdin.readline().rstrip()
# N = int(sys.stdin.readline())
# INF = float("inf")
import sys
A,B,C = map(int,sys.stdin.readline().split())
K = int(sys.stdin.readline())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    a, b, c = list(map(int, input().split()))
    k = int(input())
    # if b == 1 or c == 1:
    #     print('No')
    #     return
    # count = 0
    # while count < k:
    #     if b <= a:
    #         b *= 2
    #         count += 1
    #         continue
    #     elif c <= b:
    #         c *= 2
    #         count += 1
    #         continue
    #     else:
    #         break
    for i in range(k):
        if b <= a:
            b *= 2
            continue
        elif b > a and c <= b:
            c *= 2
            continue
        elif b > a and c > b:
            break
    if a < b and b < c:
        print('Yes')
    else:
        print('No')

main()

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())
K = int(input())
cnt = 0
for _ in range(K):
	if A>=B:
		B *= 2
		cnt += 1
	else:
		break

for _ in range(K-cnt):
	if B>=C:
		C *= 2
	else:
		break
#print(cnt)

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 c<=b or c <= b*2:
    c*=2
  elif b<=a or b <= a*2:
    b*=2
  else:
    a*=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 c>b and b>a:
    print("Yes")
else:
    if b<=a:
        while(b<=a and k>0):
            b=b*2
            k-=1
    if c<=b:
        while(c<=b and k>0):
            c=c*2
            k-=1
    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())
L = []
for i in range(K+1):
    for j in range(K+1):
        if i+j > K:
            break
        if A*(2**i) < B*(2**j) < C*(2**(K-i-j)):
            L.append('Yes')
            break

if len(L)==0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(k):
    if a >= b:
        b = 2 * b
        continue
    if b >= c:
        c = 2 * c
        continue
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(0,k+1):
    for j in range(0,k+1-i):
        if a<b*(2**i)<c*(2**j):
            ans="Yes"

print(ans)

Submission status: Accepted

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

while k>=1:
    if a>=b:
        k-=1
        b*=2
    else:
        break
while k>=1:
    if b>=c:
        k-=1
        c*=2
    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())
ans = [[a,b,c]]
ans2 = []
for i in range(k):
  b = []
  for j in range(len(ans)):
    a = ans[j]
    a1,b1,c1 = a[0]*2,a[1]*2,a[2]*2
    b.append([a1,a[1],a[2]])
    b.append([a[0],b1,a[2]])
    b.append([a[0],a[1],c1])
  ans = b
t = 0
for i in ans:
  if i[0] < i[1] < i[2]:
    t = 1
    break
if t == 1:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import itertools

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

ABC = ['A', 'B', 'C']


def solve():
    for kk in range(1, k + 1):
        for x in list(itertools.product([0, 1, 2], repeat=kk)):
            abc = [a, b, c]
            for xx in x:
                abc[xx] = abc[xx] * 2

            if abc[0] < abc[1] < abc[2]:
                return 'Yes'

    return 'No'


print(solve())

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#A = red B = green C = blue

import sys

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

A, B, C = a ,b, c
listS =[]
for N_a in range(K):
    for N_b in range(K-N_a):
        N_c = K-N_a-N_b
        listS.append((N_a,N_b,N_c))
for i in range(len(listS)):
    A *= 2 ** listS[i][0]
    B *= 2 ** listS[i][1]
    C *= 2 ** listS[i][2]
    if B > A and C > B:
        print('Yes')
        sys.exit()
    else:
        pass
#     print(A,B,C)
    A, B, C = a ,b, c
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
    elif b >= c:
        c = 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())

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:
#標準入力
A,B,C = map(int,input().split())
K=int(input())

cnt = 0

while A >= B:
    B=B*2
    cnt+=1
    if A < B:
        break

while B >= C:
    C=C*2
    cnt+=1
    if B < C:
        break

ans = 'Yes' if cnt <= K else 'No'

print(ans)

Submission status: Accepted

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

import math
b=0

if B>A:
	b=0
elif 2*B>A:
	b=1
	B=2*B
elif 4*B>A:
	b=2
	B=4*B
else:
	b=3
	B=8*B

c=0
if C>B:
	c=0
elif 2*C>B:
	c=1
elif 4*C>B:
	c=2
elif 8*C>B:
	c=3
elif 16*C>B:
	c=4
elif 32*C>B:
	c=5
else:
	c=6



if b+c<=K:
	print("Yes")
else:
	print("No")



# 2darray [[0] * 4 for i in range(3)]

Submission status: Accepted

Solution code:
from collections import deque

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

q = deque([[a,b,c,k]])

while len(q) != 0:
    tmp = q.popleft()
    if tmp[0] < tmp[1] and tmp[1] < tmp[2]:
        print('Yes')
        flag = 1
        break
    elif tmp[3] > 0:
        q.append([tmp[0],2*tmp[1],tmp[2],tmp[3]-1])
        q.append([tmp[0],tmp[1],2*tmp[2],tmp[3]-1])

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

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())
K = int(input())
while K != 0:
  if A >= B:
    B *= 2
  elif B >= C:
    C *= 2
  K -= 1

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+1):
    for j in range(K+1):
        for k in range(K+1):
            if i + j + k <= K:
                A1 = A * 2 ** i
                B1 = B * 2 ** j
                C1 = C * 2 ** k
                if A1 < B1 < C1:
                    print('Yes')
                    exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import random

def Magic2():
    
    num = list(map(int,input().split()))

    count = int(input())

    for i in range(count):
        if num[0] >= num[1]:
            num[1] = 2*num[1]
            
        elif num[1] >= num[2]:
            num[2] = 2*num[2]
        
        else:
            num[2] = 2*num[2]
            
        
    if num[0] < num[1] and num[1] < num[2]:
        print('Yes')
        
    else:
        print('No')
        

if __name__ == '__main__':
    Magic2()

Submission status: Accepted

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

while count < K:
    if C <= B:
        C = C * 2
        count += 1
    elif B <= A:
        B = B * 2
        count += 1
    else:
        count += 1

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

Submission status: Accepted

Solution code:
from sys import stdin


def readline_from_stdin() -> str:
    return stdin.readline().rstrip


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

    for k in range(K):
        if not B > A:
            B *= 2
            continue
        if not C > B:
            C *= 2
            continue

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

Submission status: Accepted

Solution code:
#-------------
A,B,C = map(int, input().split())
K = int(input())
#-------------
card = []
for i in range(K):
  B_x = B*(2**i)
  C_x = C*(2**(K-i))
  card.append([A,B_x,C_x])

cnt = 0
for i in range(len(card)):
  if card[i][2] > card[i][1] > card[i][0] :
    cnt +=1

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

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
r,g,b= a[0],a[1],a[2]
k=int(input())
m=0
for i in range(k):
    if g>r:
        break
    g*=2
    m+=1
d = k -m
b=b*(2**d)

if b>g and g >r:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inputs =[i for i in map(int,input().split())]
k = int(input()) 
while True:
  if k == 0:
    break
  if not inputs[1] > inputs[0]:
    inputs[1] *=2
    k -=1
  else:
    break
if inputs[0] >= inputs[1]:
  print('No')
while True:
  if k == 0:
    break
  if not inputs[2] > inputs[1]:
    inputs[2] *=2
    k -=1
  else:
    break
if inputs[2] > inputs[1]:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import math

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


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:
import sys
input = sys.stdin.buffer.readline

#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()

def main():
	a,b,c=MI()
	k=II()

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

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

	#print(a,b,c,k)

	if k>=0:
		ans="Yes"
	else:
		ans="No"

	print(ans)






if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
k = int(input())
cnt = 0
for i in range(k):
  if a<b:
    break
  b *= 2
  cnt += 1
if (a >= b) or (k-cnt<0):
  print("No")
else:
  for i in range(k-cnt):
    if b<c:
      break
    c *= 2
  if b<c:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split()) #A赤＜B緑＜C青，
K = int(input())

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

while B >= C and K >= 1:
  C *= 2
  K -= 1
  #print(K,C)

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

else:
  print("No")

Submission status: Accepted

Solution code:
def countup(a, b):
    count = 0
    if a < b:
        return count
    else:
        while a >= b:
            b *= 2
            count += 1
        return count


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

count = countup(A, B)
B_ = B * (2 ** count)
count += countup(B_, C)

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

Submission status: Accepted

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

ans = "No"
if r < g < b:
    ans = "Yes"
else:
    g_multi_num = 0
    b_multi_num = k
    for _ in range(k+2):
        if r < g * (2 ** g_multi_num) < b * (2 ** b_multi_num):
            ans = "Yes"
        g_multi_num += 1
        b_multi_num -= 1
print(ans)

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
K = int(input())
def func(i: int, a: int, b: int, c: int):
    if i == K:
        return (a < b and b < c)
    if func(i + 1, a * 2, b, c):
        return True
    if func(i + 1, a, b * 2, c):
        return True
    if func(i + 1, a, b, c * 2):
        return True
    return False
    
if func(0, A, B, C):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
data = input().split()
for i in range(len(data)):
  data[i] = int(data[i])
K = int(input())
for i in range(K):
  if data[0] >= data[1]:
    data[1] = data[1]*2
  elif data[1] >= data[2]:
    data[2] = data[2]*2
if data[0] >= data[1]:
  print('No')
elif data[1] >= data[2]:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
A,B,C = map(int, input().split())
K=int(input())
counter = 3**K
ans = False


for i in range(counter):
    tmp = i
    Ad= A
    Bd=B
    Cd=C
    for j in range(K):
        if tmp%3 ==0:
            Ad *=2
        elif tmp%3 ==1:
            Bd*=2
        else:
            Cd*=2
        tmp =tmp//3
    if Ad<Bd and Bd<Cd:
        ans =True



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

Submission status: Accepted

Solution code:
import itertools
import math
import fractions
import functools
import copy
from collections import deque
from functools import reduce
from decimal import Decimal


def main():
    a, b, c = map(int, input().split())
    k = int(input())
    x = 0
    y = 0
    z = 0
    for x in range(0, k+1):
        for y in range(0, k-x+1):
            for z in range(0, k-(x+y)+1):
                a1 = a * (2 ** x)
                b1 = b * (2 ** y)
                c1 = c * (2 ** z)
                a2 = a * (2 ** x)
                b2 = b * (2 ** z)
                c2 = c * (2 ** y)
                a3 = a * (2 ** y)
                b3 = b * (2 ** x)
                c3 = c * (2 ** z)
                a4 = a * (2 ** y)
                b4 = b * (2 ** z)
                c4 = c * (2 ** x)
                a5 = a * (2 ** z)
                b5 = b * (2 ** x)
                c5 = c * (2 ** y)
                a6 = a * (2 ** z)
                b6 = b * (2 ** y)
                c6 = c * (2 ** x)
                if (a1 < b1 and b1 < c1) or (a2 < b2 and b2 < c2) or(a3 < b3 and b3 < c3) or (a4 < b4 and b4 < c4) or (a5 < b5 and b5 < c5) or (a6 < b6 and b6 < c6):
                    print("Yes")
                    exit()
    print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
k=int(input())
x='No'
for i in range(k+1):
  A=a*2**i
  for j in range(k-i+1):
    B=b*2**j
    C=c*2**(k-i-j)
    if A<B<C:
      x='Yes'
print(x)

Submission status: Accepted

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

c = 0
while B <= A:
    B *= 2
    c += 1
    if K < c:
        print("No")
        exit()

while C <= B:
    C *= 2
    c += 1
    if K < c:
        print("No")
        exit()

print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
a0,b0,c0 = map(int, input().split())
k = int(input())
p = itertools.product(range(3),repeat = k)
ans = 'No'
for i in p:
    a,b,c = a0,b0,c0
    for ii in i:
        if ii == 0:
            a = 2*a
        elif ii == 1:
            b = 2*b
        elif ii == 2:
            c = 2*c
        
        if b > a and c > b:
            ans = 'Yes'
            break
    if ans == 'Yes':
        break
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
from collections import defaultdict
from collections import deque
from functools import reduce
import math
import itertools
import heapq
#import numpy as np
import bisect
import sys
#import sympy
sys.setrecursionlimit(10**6)


def bfs(s, n, node):
    # 頂点が探索済みかどうかのチェック配列
    check = [False for _ in range(n)]
    check[s] = True
    # 次見る頂点を格納するキュー
    queue = deque([s])
    visited_num = 1

    # 問題固有の配列
    #color_check=[[True for _ in range(l)] for _ in range(n)]
    color = [-1 for _ in range(n)]
    color[s] = 0

    while visited_num < n:
        # グラフが全連結ではない場合
        if len(queue) == 0:
            # 空配列を返す
            # 現状までの計算済み配列を返してもいいと思う
            return color

        now_vertex = queue.popleft()
        # インデックスがない場合は
        for next_vertex in node[now_vertex]:

            if check[next_vertex] == True:
                continue

            queue.append(next_vertex)
            check[next_vertex] = True

            # 問題固有の計算
            color[next_vertex] = color[now_vertex]+1
            visited_num += 1

    return color


mod = 10**9+7
# n=int(input())
# n,m=list(map(int,input().split()))
# a=list(map(int,input().split()))
def ceil(x, y): return (x+y-1)//y
def input_list(): return list(map(int, input().split()))


def buy(buy_cost, sell_cost, money):
    return money % buy_cost+(money//buy_cost)*sell_cost


a, b, c = input_list()
n = int(input())
ans = 0
if a >= b:
    tmp = math.ceil(math.log((a+1)/b, 2))
    ans += tmp
    b *= 2**tmp


if b >= c:
    tmp = math.ceil(math.log((b+1)/c, 2))
    ans += tmp

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

Submission status: Accepted

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

if a >= b:
  p = int(math.log(a/b,2)) +1
else:
  p = 0
  
if b*(2**p) >= c:
  q = int(math.log(b*(2**p)/c,2)) +1
else:
  q = 0
#print(p)
#print(q)

if (p + q) <= k:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
def chck(n1, n2) :
	c = 0
	while(n2 <= n1) :
		n2 = n2 * 2
		c = c + 1
	return c, n2

def main() :
	a, b, c = list(int(j) for j in input().strip().split())
	k = int(input())
	m1, b = chck(a, b)
	m2, c = chck(b, c)
	mi = m1 + m2
	if mi <= 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())

if a<b and b<c:
	print("Yes")
elif a<b:
	for i in range(1,10):
			c=c*2
			if c>b:
				n=i
				break;
	if n<=k:
		print("Yes")
	else:
		print("No")
else:
	for i in range(1,10):
		b=b*2
		if b>a:
			m=i
			break;
	#print(m)
	for i in range(1,10-m):
		c=c*2
		if c>b:
			n=i
			break;
	#print(n)
	if n+m<=k:
		print("Yes")
	else:
		print("No")

Submission status: Accepted

Solution code:
import numpy as np
line = list(map(int, input().split()))
k = int(input())
ans = 'No'
  
for i in range(2 ** k):
  _array = np.copy(line)
  for j in range(k):
    if ((i >> j) & 1):
      _array[1] *= 2
    else:
      _array[2] *= 2
  if (_array[0] < _array[1] and _array[1] < _array[2]):
    ans = 'Yes'
    break
print (ans)

Submission status: Accepted

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

for i in range(K):
    if A >= B:
        B = B * 2
        Ak = i + 1
    else:
        break

if K - Ak > 0:
    for j in range(K - Ak):
        if B >= C:
            C = C * 2
else:
    print("No")
    exit()

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

Submission status: Accepted

Solution code:
R, G, B = [int(x) for x in input().strip().split(" ")]
K = int(input().strip())

success = False
while K > 0:
    if R >= G:
        G *= 2
    elif G >= B:
        B *= 2
    if R < G < B:
        success = True
        break
    K -= 1
print("Yes" if success else "No")

Submission status: Accepted

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

ans=0
for i in range(k):
    for j in range(k-i):
        a2=a*(2**i)
        b2=b*(2**j)
        c2=c*(2**(k-i-j))
        if a2<b2 and b2<c2:
            ans+=1
            break
        else:
            continue

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

con=0
while b>=c:
    c=c*2
    con+=1

total=con+count

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
k = int(input())
i = 0
while i < k:
    if a >= b:
        b *= 2
    elif b >= c:
        c *= 2
    i += 1
#print(a,b,c)
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 b<=a:
        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())
 
i = 0
while a >= b:
  b = b * 2
  i += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

for kkk in range(0, 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:
i = list(map(int, input().split())) #i_1 i_2を取得し、iに値を入れる

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

K = int(input())
count = 0

for i in range(K):
  if B<=A:
    B = B*2
    count = count + 1
  if B>A:
    break
    

for i in range(K-count):
  if C<=B:
    C = C*2
  if C>B:
    print("Yes")
    break

if A>=B:
  print("No")
elif B>=C:
  print("No")

Submission status: Accepted

Solution code:
l = list(map(int, input().split()))
K = int(input())

def check(nums):
    if nums[0] < nums[1]:
        if nums[1] < nums[2]:
            print('Yes')
            exit(0)

check(l)
for i in range(K):
    if l[0] >= l[1]:
        l[1] *= 2
        check(l)
        continue
    elif l[1] >= l[2]:
        l[2] *= 2
        check(l)
        continue

print('No')

exit(0)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys
A,B,C = map(int, input().split())
K=int(input())
c=0
while A>=B:
  B=B*2
  c+=1
  if c>K:
    print("No")
    sys.exit()
while B>=C:
  C=C*2
  c+=1
  if c>K:
    print("No")
    sys.exit()
print("Yes")

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
k=int(input())
for i in range(k+1):
    bb=b*(2**i)
    cc=c*(2**(k-i))
    if bb > a and cc > bb:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
import itertools
A, B, C = map(int, input().split())
K = int(input())
targets = [A, B, C]
answer = 'No'

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

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

print(answer)

Submission status: Accepted

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

for a in range(K+1):
    for b in range(K+1):
        for c in range(K+1):
            if a + b + c <= K:
                if B * (2**b) > A * (2**a) and C * (2**c) > B * (2**b):
                    ans = 'Yes'

print(ans)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
d=int(input())
ans=0
for i in range(d):
  if a<b:
    pass
  else:
    b=b*2
    ans=ans+1
for j in range(d-ans):
  if b<c:
    pass
  else:
    c=c*2
    ans=ans+1
if c>b:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

for i in range(k+1):
    b_list.append(b*(2**i))
    c_list.append(c*(2**i))

for j in range(k):
    if b_list[j]>a and c_list[k-j]>b_list[j]:
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10**6)

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

m = [[] for _ in range(8)]
m[0].append([a,b,c])

for i in range(k):
    for j in m[i]:
        m[i+1].append([j[0]*2, j[1],j[2]])
        m[i+1].append([j[0], j[1]* 2, j[2]])
        m[i+1].append([j[0], j[1], j[2]* 2])

ans = 'No'

for t in m[k]:
    if t[0] < t[1] and t[1] < t[2]:
        ans = 'Yes'
        break
print(ans)

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
k = int(input())
cnt = 0
if c > b > a:
    print('Yes')
    exit()

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

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

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