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())
n=int(input()) 
 
k = n
 
if a < b < c:
    print('Yes')
 
if a < b and b >= c:
    while  b >= c and k >= 1:
        c = 2*c
        k -= 1
        if b >= c and k == 0:
            print('No')
        if b < c and k>=0:
            print('Yes')
 
if a >= b:
    while a >= b and k >= 1:
        b = 2*b
        k -= 1
        if a >= b and k == 0 :
            print('No')
        if a < b and b >= c and k == 0:
            print('No')
        if a < b < c:
            print('Yes')
            break
        if a < b and b >= c and k >= 1:
            while  b >= c and k >= 1:
                c = 2*c
                k -= 1
                if b >= c and k == 0:
                    print('No')
                if b < c and k>=0:
                    print('Yes')
                    break

Submission status: Accepted

Solution code:
import sys
import itertools
sys.setrecursionlimit(10000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy

a,b,c = map(int,input().split())
k = int(input())
cnt = 0
while True:
    if cnt == k:
        break
    if c<=b:
        c = 2*c
    elif b<=a:
        b = 2*b
    cnt+=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())
for i in range(0,k+1):
  if a<b*(2**i)<c*(2**(k-i)):
    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 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:
card = input().split(" ")
turn = int(input())

red = int(card[0])
green = int(card[1])
blue = int(card[2])

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

if green > red and blue > green:
  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:
    break
  elif A >= B:
    B *= 2
  elif B >= C:
    C *= 2
  
    
if A < B < C:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

magic = int(input())

for i in range(magic) :
    if red >= green :
        green = green * 2
    elif green >= blue :
        blue = blue * 2
    
    if blue > green and green > red :
        break

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

Submission status: Accepted

Solution code:
a,b,c = map(int, input().split())
x = int(input())
for _ in range(x):
    if a >= b:
        b *= 2
    elif b >= c:
        c *= 2

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

Submission status: Accepted

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

while k:
    if r < g:
        break

    g *= 2
    k -= 1

while k:
    if g < b:
        break

    b *= 2
    k -= 1

ans = 'No'
if r < g < b:
    ans = 'Yes'

print(ans)

Submission status: Accepted

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

    
while B>=C:
    C*=2
    a-=1
    
if a>=0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
from queue import deque

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

que = deque([(A, B, C, K)])
visited = set()

while que:
    a, b, c, k = que.pop()
    if (a, b, c, k) in visited or k < 0:
        continue
    visited.add((a, b, c, k))
    if k == 0 and a < b < c:
        print('Yes')
        exit()
    que.append((a*2, b, c, k-1))
    que.append((a, b*2, c, k-1))
    que.append((a, b, c*2, k-1))
print('No')

Submission status: Accepted

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

for _ in range(k):
    if c <= max(a, b): c *= 2
    elif a >= b: b *= 2
    if a<b<c:
        ans = 'Yes'
        break
else:
    ans = 'No'
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 25 20:54:45 2020

@author: naoki
"""

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

for i in range(0,8):
    for j in range(0,8):
        for k in range(0,8):
            Aa = A * 2**i
            Ba = B * 2**j
            Ca = C * 2**k
            
            if i+j+k <= K and Aa < Ba and Ba < Ca:
                print("Yes")
                sys.exit()
print("No")

Submission status: Accepted

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

for i in range(K+1):
  _B = B * (2 ** i)
  if A < _B:
    for j in range(K+1-i):
      _C = C * (2 ** j)
      if _B < _C:
        print('Yes')
        break
    else:
      continue
    break
else:
  print('No')

Submission status: Accepted

Solution code:
from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
import math
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math as M
MOD=10**9+7
import sys
#####################################
a,b,c=INPUT()
x=int(input())
bool=True
if b<=a:
    while(b<=a and x>0):
        b*=2
        x-=1
    if b>a:
        if b>=c:
            while(b>=c and x>0):
                c*=2
                x-=1
            if x<0 or c<=b:
                bool=False
    else:
        bool=False
else:
    if b>=c:
        while(b>=c and x>0):
            c*=2
            x-=1
        if x<0 or c<=b:
            bool=False
    
if bool is True:
    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 c<=b or c<=a:
        c*=2
    elif b<=a:
        b*=2
    else:
        c*=2
print("Yes" if c>b and b>a else "No")

Submission status: Accepted

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

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

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

Submission status: Accepted

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

for i in range(K):
    if C <= B:
        C = C * 2
    elif 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:
R,G,B=map(int,input().split())
K=int(input())
#print(R,G,B,K)

for i in range(K):
  #print(R,G,B,K)
  if(B<=G):
    B*=2
    continue
  if(G<=R):
    G*=2
    continue
#print(R,G,B,K)
if(R<G and G<B):
  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 >= c:
    c *= 2
  elif a >= b:
    b *= 2
  else:
    c *= 2

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

Submission status: Accepted

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


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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

A, B, C = int(A), int(B), int(C)

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

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

Submission status: Accepted

Solution code:
import sys
a, b, c = [int(x) for x in input().split()]
k = int(input())
i = 0
while b<=a:
  i += 1
  b *= 2
if(k<i):
  print('No')
  sys.exit()
else:
  k -= i
  j = 0
  while c<=b:
    j += 1
    c *= 2
  if(k<j):  
    print('No')
    sys.exit()
  else:
    print('Yes')

Submission status: Accepted

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

for i in range(k):

    if li[0] >= li[1]:
        li[1]=li[1]*2
    elif li[2] <= li[1]:
        li[2]=li[2]*2
    if li[0] < li[1] and li[1] < li[2]:
        print("Yes")
        quit()
print("No")

Submission status: Accepted

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

for k 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(int,input().split())
k=int(input())
count=0
while b<=a:
  b*=2
  count+=1
while c<=b:
  c*=2
  count+=1
if k>=count:
  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):
    while (a>=b):
        b = b*2
        ans+=1
if (b>=c):
    while (b>=c):
        c = c*2
        ans+=1 

if ans <=k:
    print("Yes")
else:
    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:
import itertools
A, B, C = map(int,input().split())
K = int(input())
ans = 'No'
ls = []
for i in range(K+1):
    for j in range(K+1-i):
        l = K-i-j
        ls.append([i,j,l])
for lis in ls:
    if A*2**lis[0] < B*2**lis[1] and B*2**lis[1] < C*2**lis[2]:
        ans = 'Yes'
        break
print(ans)

Submission status: Accepted

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

x,y = 0,0

if A > B:
    if math.modf(math.log2(A/B))[0] != 0:
        x = math.ceil(math.log2(A/B))
    else:
        x = math.ceil(math.log2(A/B))+1
elif A == B:
    x = 1
else:
    pass

if B*(2**x) > C:
    if math.modf(math.log2((B*(2**x))/C))[0] != 0:
        y = math.ceil(math.log2((B*(2**x))/C))
    else:
        y = math.ceil(math.log2((B*(2**x))/C))+1    
elif B*(2**x) == C:
    y = 1
else:
    pass


if x + y <= K:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

import math

numbers = input().split(" ")
a = int(numbers[0])
b = int(numbers[1])
c = int(numbers[2])

k = int(input())



for i in range(k):
    if a < b:
        break
    b *= 2
    k -= 1

c = c * (2 ** k)

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())
canhe = True
passOne = False
abk = 0
bck = 0
bc = b
cc = c
while True:
    if abk > k:
        canhe = False
        break
    if bc <= a:
        bc *= 2
        abk += 1
    else:
        passOne = True
        break
if passOne:
    while True:
        if bck > k-abk:
            canhe = False
            break
        if cc <= bc:
            cc *= 2
            bck += 1
        else:
            break
if canhe:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import bisect
import copy
import heapq
import sys
import itertools
import math
from functools import lru_cache
from collections import deque
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7 

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]


def main():
    A, B, C = read_values()
    K = int(input())

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

res = False

t = 0
while t <= K and A >= B:
    t = t + 1
    B = B * 2
while t <= K and B >= C:
    t = t+ 1
    C = C * 2


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

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = 0
while a[0] >= a[1]:
  a[1] = a[1] * 2
  c += 1
while a[1] >= a[2]:
  a[2] = a[2] * 2
  c += 1
if c <= b[0]:
  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(0,k+1):
  if b*2**i > a:
    d = i
    e = b*2**i
    break
else:
  print('No')
for i in range(0, k-d+1):
  if c*2**i > e:
    print('Yes')
    break
else:
  print('No')

Submission status: Accepted

Solution code:
import itertools
import copy
A, B, C = map(int,input().split())
K = int(input())
ckList = list(itertools.product([0,1,2], repeat=K))
for i in ckList:
    numList = [copy.copy(A),copy.copy(B),copy.copy(C)]
    for j in i:
        numList[j] *= 2
    if numList[1] > numList[0] and numList[2] > numList[1]:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

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

ans = 'No'
d = 0

for i in range(1,k+1):
    if b <= a:
        d = d + 1
        b = b * 2
    else:
        d = d
        b = b

if d == k:
    if c > b:
        ans = 'Yes'

f = k - d
g = 1

for j in range(1,f+2):
    if c <= b:
        c = c * 2
    else:
        ans = 'Yes'

print(ans)

Submission status: Accepted

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

flag = False
while cnt < K:
    cnt += 1
    if A >= B:
        B *= 2
    elif B >= C:
        C *= 2
    
    if A < B and B < C:
        flag = True
        break
        
        
if flag:
    print('Yes')
else :
    print('No')

Submission status: Accepted

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

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

if a < b:
    flg = 1

while n > 0:
    if flg == 0:
        b = b * 2
        n = n - 1
        #print(a,b,c)
        if a < b:
            flg = 1
            if b < c:
                print('Yes')
                exit()
    else:
        c = c * 2
        n = n - 1
        #print(a,b,c)
        if b < c:
            print('Yes')
            exit()

print('No')

Submission status: Accepted

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

flag = False

for i in range(k+1):
    for j in range(k+1-i):
        a1 = a*(2**i)
        b1 = b*(2**j)
        c1 = c*(2**(k-i-j))
        if c1 > b1 and b1 > a1:
            flag = True
            print('Yes')
            break
    if flag:
        break

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

Submission status: Accepted

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

cnt = 0

while b <= a:
    b += b
    cnt += 1

while c <= b:
    c += c
    cnt += 1

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

Submission status: Accepted

Solution code:
# m-solutions2020_b.py
# https://atcoder.jp/contests/m-solutions2020 : B

global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    A, B, C = list(map(int, lines[0].split()))
    # K = lines[1]
    K = int(lines[1])
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(N):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(N):
    #     valueses.append(list(map(int, lines[i+1].split())))

    for i in range(8):
        if A >= B:
            B *= 2
            K -= 1
    for i in range(8):
        if B >= C:
            C *= 2
            K -= 1
    log(f'K=[{K}]')
    if K < 0:
        ret = 'No'
    else:
        ret = 'Yes'

    return [ret]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['7 2 5', '3']
        lines_export = ['Yes']
    if pattern == 2:
        lines_input = ['7 4 2', '3']
        lines_export = ['No']
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(2)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    if mode > 0:
        log(f'lines_input=[{lines_input}]')
        log(f'lines_export=[{lines_export}]')
        log(f'lines_result=[{lines_result}]')
        if lines_result == lines_export:
            log('OK')
        else:
            log('NG')
    finished = time.time()
    duration = finished - started
    log(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
red_init, green_init, blue_init = map(int, input().split())
k = int(input())
mn = 10
flag = 0
for s in range(k+1) :
    for t in range(k+1-s) :
        for u in range(k+1-s-t) :
            red = red_init
            green = green_init
            blue = blue_init
            red = red_init * (2**s)
            green = green_init * (2**t)
            blue = blue_init * (2**u)
            if red < green < blue :
                flag = 1
                break
if flag == 1 :
    print("Yes")
else :
    print("No")

Submission status: Accepted

Solution code:
from math import log,floor
a,b,c = map(int,input().split())
K = int(input())
count = 0

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

while b>=c:
    c*=2
    count+=1
#print(a,b,c)
if count > K:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def main():
    A, B, C = map(int, input().split())
    K = int(input())
    for i in range(1,K+1):
        if A < B:
            i -= 1
            break
        B *= 2
    K -= i
    for i in range(1,K+1):
        if B < C:
            break
        C *= 2
    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())
if A<B<C:
  print("Yes")
  exit()
for i in range(K):
  if A >= B:
    B = B*2
  elif B >= C:
    C = C*2
  if A<B<C:
    print("Yes")
    exit()
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

while B >= C:
    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())

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

if A < B < C:
  print("Yes")
  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
    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())

a_new = 0
b_new = 0
c_new = 0

flag = 0
#print(k)
def solve():
    flag = 0
    for i in range(k+1):
        for j in range(k-i+1):
            #print(i,k,j)
            l = k - i - j
            a_new = a*2**i
            b_new = b*2**j
            c_new = c*2**l
            #print(a_new,b_new,c_new)
            if(c_new > b_new and b_new > a_new):
                flag = 1
                #print("hi")
                return flag
                
    
            
    return flag

flag = solve()

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

Submission status: Accepted

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

ans_red = 0
ans_green = 0
ans_blue = 0
for red in range(k):
    for green in range(k-red):
        blue = k - red- green
        ans_red = a * 2 ** red
        ans_green = b * 2 ** green
        ans_blue = c * 2 ** blue
        if ans_red < ans_green < ans_blue:
            print('Yes')
            exit()
        ans_red = 0
        ans_green = 0
        ans_blue = 0
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):
    r = A
    g = B
    b = C
    # r < g < b
    for i in range(K):
        if r >= g:
            g *= 2
        elif g >= b:
            b*=2
    if r<g<b: 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:
# -*- coding: utf-8 -*-

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        for line in sys.stdin:
            lines.append(line.strip())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    (a, b, c) = [int(e) for e in lines[0].split(" ")]
    k = int(lines[1])

    return (a, b, c, k)


def solve(a, b, c, k):

    a2 = a
    b2 = b
    c2 = c
    tmp = k
    while tmp > 0 and b2 <= a2:
        tmp = tmp - 1
        b2 = 2 * b2

    while tmp > 0 and c2 <= b2:
        tmp = tmp - 1
        c2 = 2 * c2

    if c2 > b2 and b2 > a2:
        result = 'Yes'
    else:
        result = 'No'
    
    return result    


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

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 = b*2
        continue
    if b>a and c<=b:
        c = c*2
    if b>a and c>b:
        print("Yes")
        exit()
    

print("No")

Submission status: Accepted

Solution code:
A,B,C =map(int,input().split())
K = int(input())
num = 0
for i in range(K):
    if A>=B:
        B *= 2
        num += 1
    else:
        break
for j in range(K-num):
    C *= 2
if A<B<C:
    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 < b:
        break
    else:
        if g <= r:
            g *= 2
        elif b <= g:
            b *= 2
        else:
            b *= 2

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

Submission status: Accepted

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

flg = False

for i in range(k+1):
  d = 2**i*b
  e = 2**(k-i)*c
  if a < d < e:
    flg = True
    break

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
# A: red, B: green, C: blue
# A < B < C

A, B, C = [ int(v) for v in input().split(" ") ]
K = int(input())

# A < B
for i in range(K):
  if A >= B:
    B *= 2
    K -= 1
  else:
    break

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

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

#print(A,B,C)
#print(K)

Submission status: Accepted

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

for i in range(K+1):
  if( i == K+1 ):
    break
  for j in range(K+1):
    if( i + j == K+1 ):
      break
    for k in range(K+1):
      if( i + j + k == K+1 ):
        break
      if A*(2**i) < 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())

ans = 'No'

def solve(a, b, c, k):
    global ans
    if a < b < c:
        ans = 'Yes'
        return

    if k == 0:
        return

    solve(a*2, b, c, k-1)
    solve(a, b*2, c, k-1)
    solve(a, b, c*2, k-1)

solve(a, b, c, k)
print(ans)

Submission status: Accepted

Solution code:
import sys
import numpy as np
import math
import collections
import copy
from collections import deque 
from functools import reduce
from itertools import product

A, B, C = map(int, input().split())
K = int(input())
for p in product((1, 2, 3), repeat=K):
    R, G, BL = A, B, C
    for pi in p:
        if pi == 1:
            R *= 2
        if pi == 2:
            G *= 2
        if pi == 3:
            BL *= 2
    if R < G < BL:
        print("Yes")
        break
else:
    print("No")

Submission status: Accepted

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

num = 0

while (True):
    if  (num == K):
        break
        
    if (R >= G):
        G *= 2
        num += 1
        
    if (R < G):
        break
    
while (True):
    if  (num == K):
        break
        
    if (G >= B):
        B *= 2
        num += 1
        
    if (G < B):
        break

if (R < G and G < B):
    ans = 'Yes'
    
print(ans)

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main():
    A, B, C, K = map(int, read().split())
    for i in range(K):
        if A>=B:
            B *= 2
        elif B>=C:
            C *= 2
        else:
            break
    if A<B<C:
        print('Yes')
    else:
        print('No')
    return

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

  
  
for i in range(K):
  if(A_list[0]>=A_list[1]):
    A_list[1] = A_list[1]*2
  elif(A_list[1]>=A_list[2]):
    A_list[2] = A_list[2]*2
  #print(A_list)
    
    
sort_ = sorted(A_list)
set_ = sorted(list(set(A_list)))
#print(A_list,set_)
if(A_list != set_):
  print("No")
elif(A_list == sort_):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    A, B, C = map(int, input().split())
    K = int(input())
    
    while K>0:
        if A < B: break
        else:
            B*=2
            K-=1

    while K>0:
        if B < C: break
        else:
            C*=2
            K-=1


    
    ans = "No"
    if A<B and B<C:
        ans = "Yes"



    return ans

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

Submission status: Accepted

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

count = 0
while count < k and not (a < b < c):
    if a >= b:
        count += 1
        b = 2*b
    if b >= c:
        count += 1
        c = 2*c

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

Submission status: Accepted

Solution code:
[a, b, c] = [int(x) for x in input().split(" ")]
k = int(input())
a_b_flg = False if a >= b else True
b_c_flg = False if b >= c else True

for kdx in range(0, k):
  if not a_b_flg:
    b = b*2
  elif not b_c_flg:
    c = c*2
  a_b_flg = False if a >= b else True
  b_c_flg = False if b >= c else True
  if a_b_flg and b_c_flg:
    print('Yes')
    break
if not (a_b_flg and b_c_flg):
  print('No')

Submission status: Accepted

Solution code:
import sys

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


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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
# 幅優先探索（行きがけ）
import collections
import sys
import copy
import re
import math


def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())


def main():
    A, B, C = LI()
    K = I()
    for i in range(K):
        if A >= B:
            B *= 2
        else:
            if B >= C:
                C *= 2
            else:
                break

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


if __name__ == '__main__':
    main()