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,K = map(int, open(0).read().split())
count = 0
while B <= A:
    if count < K:
        count += 1
        B *= 2
    else:
        print('No')
        break
else:
    while C <= B:
        if count < K:
            count += 1
            C *= 2
        else:
            print('No')
            break
    else:
        print('Yes')

Submission status: Accepted

Solution code:
#m-solutions2020 b
import sys  
input = sys.stdin.readline


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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[4]:


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


# In[5]:


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


# In[ ]:

Submission status: Accepted

Solution code:
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
import sys;input = sys.stdin.readline
inp,ip = lambda :int(input()),lambda :[int(w) for w in input().split()]

a,b,c = ip()
k = inp()

ct = 0
while b <= a:
    b *= 2
    ct += 1
while c <= b:
    c *= 2
    ct += 1

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

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

Submission status: Accepted

Solution code:
LI = lambda: list(map(int, input().split()))

A, B, C = LI()
K = int(input())


def main():
    a, b, c = A, B, C
    for _ in range(K):
        if a >= b:
            b *= 2
        elif b >= c:
            c *= 2
    if a < b < c:
        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())

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



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:
# coding: utf-8


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

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

        c *= 2
        K -= 1
    
    if a < b < c:
        return "Yes"
    else:
        return "No"


print(main())

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def main():
    input = sys.stdin.buffer.readline
    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
    print("Yes" if cnt <= k else "No")


if __name__ == "__main__":
    main()

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

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

Submission status: Accepted

Solution code:
def main():

    A, B, C = map(int, input().split())
    K = int(input())
    for i in range(K+1):
        for j in range(K+1):
            for l in range(K+1):
                if i + j + l <= K:
                    x = A * pow(2, i)
                    y = B * pow(2, j)
                    z = C * pow(2, l)
                    if x < y and y < z:
                        return "Yes"
    return "No"

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

Submission status: Accepted

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

K = int(input())

c = 0

while True:
    if A >= B:
        B *= 2
        c += 1
    elif B >= C:
        C *= 2
        c += 1
    else:
        break

if c <= K:
    print("Yes")

else:
    print("No")

Submission status: Accepted

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

k = 0
while A >= B:
    B *= 2
    k += 1
while B >= C:
    C *= 2
    k += 1
print('Yes' if k <= K else '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
    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())
cnt=0
while a>=b:
  b*=2
  cnt+=1
while b>=c:
  c*=2
  cnt+=1
if k>=cnt:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

    cnt = 0
    while True:
        if b > a:
            break
        cnt += 1
        b *= 2

    while True:
        if c > b:
            break
        cnt += 1
        c *= 2
    
    if cnt <= 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())

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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())

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

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

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

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

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

Submission status: Accepted

Solution code:
import sys

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

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

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

else:
	print("No")

Submission status: Accepted

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

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

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

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

else:
    print("No")

Submission status: Accepted

Solution code:
r, g , b = map(int, input().split())
k = int(input())
while(g <= r):
	g *= 2
	k -= 1
while(b <= g):
	b *= 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())
b = B
c = C

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=map(int,input().split())
k=int(input())
cnt=0
while not a<b:
    b=2*b
    cnt+=1
while not b<c:
    c=2*c
    cnt+=1
if cnt>k:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

count = 0
while g <= r:
    count += 1
    g *= 2

while b <= g:
    count += 1
    b *= 2

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 b <= a:
    b *= 2
    cnt += 1
while c <= b:
    c *= 2
    cnt += 1
print("Yes" if cnt <= k else "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
print("YNeos"[cnt>k::2])

Submission status: Accepted

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

b = 0
while (b <= K and A >= 2**b * B):
    b += 1

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

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:
R = 0
G = 1
B = 2


def check(ns):
    return ns[G] > ns[R] and ns[B] > ns[G]

def solve(ns, k):
    if check(ns):
        return True
    if k == 0:
        return False
    for i in xrange(3):
        ms = ns[:]
        ms[i] *= 2
        if solve(ms, k - 1):
            return True
    return False


assert solve([7, 2, 5], 3) == True
assert solve([7, 4, 2], 3) == False


ns = map(int, raw_input().split())
k = int(raw_input())

print 'Yes' if solve(ns, k) else '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')
        exit()
print('No')

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
K = int(input())
ans = False
for i in range(K+1):
    j = K - i
    B_i = B*(2**i)
    C_i = C*(2**j)
    if A < B_i and B_i < C_i:
        ans = True

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

Submission status: Accepted

Solution code:
def main():
    r,g,b = map(int, input().split())
    k=int(input())
    for _ in range(k):
        if r >= g:
            g *= 2
        elif g >= b:
            b *= 2
        else:
            break
    print("Yes" if r<g<b else "No")

if __name__ == '__main__':
    main()

Submission status: Accepted

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

for i in range(k):
    if a >= b:
        b *= 2
    else:
        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())
out = "No"
while K > 0:
    if B<=A:
        B = B*2
    elif C<=B:
        C = C*2
    if C>B>A:
        out = "Yes"
    K = K-1

print(out)

Submission status: Accepted

Solution code:
def main():
    A,B,C=map(int,input().split())
    K=int(input()) 
    for _ in range(K):
        if not A<B: 
            B *=2
            continue
        if not B < C:
            C *=2
            continue
        break
    if A<B<C:
        print("Yes")
    else:
        print("No")

main()

Submission status: Accepted

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

Submission status: Accepted

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

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

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

#print('num:', num)
if num <= K:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import product
a, b, c = list(map(int, input().split()))
k = int(input())
for bit in product([0, 1, 2, 3], repeat=k):
    aa, bb, cc = [a, b, c][:]
    for t in bit:
        if t == 0:
            pass
        elif t == 1:
            aa *= 2
        elif t == 2:
            bb *= 2
        elif t == 3:
            cc *= 2
    if aa < bb < cc:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
a,b,c = readInts()
k = I()
for i in range(k):
    if a < b < c:
        print('Yes')
        exit()

    if a >= b:
        b *= 2
    elif b >= c:
        c *= 2
    #print(a,b,c)
if a < b < c:
    print('Yes')
    exit()
else:print('No')

Submission status: Accepted

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

ans = 0

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

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

print("Yes" if ans <= k else "No")

Submission status: Accepted

Solution code:
b = list(map(int, input().split()))
K = int(input())
for i in range(3 ** K):
    a = b[::]
    for j in range(K):
        a[i % 3] *= 2
        i //= 3
    if a[0] < a[1] and a[1] < a[2]:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    A,B,C=mi()
    K=ii()

    def f(X,Y,Z,k):
        if X < Y < Z: return True
        elif k == 0: return False

        return f(X*2,Y,Z,k-1) or f(X,Y*2,Z,k-1) or f(X,Y,Z*2,k-1)
    
    ans = f(A,B,C,K)
    print("Yes" if ans else "No")




if __name__ == "__main__":
    main()

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
    else:
        print("Yes")
        exit()
    K -= 1
print("No")

Submission status: Accepted

Solution code:
A,B,C = map(int,input().rstrip().split(" "))
K = int(input())
ans = False
for i in range(K):
    if A >= B:B *= 2
    elif B >= C:C *= 2
    else:
        ans = True
        break
if A < B < C:ans = True
if ans:print("Yes")
else:print("No")

Submission status: Accepted

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

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


def solve(A: int, B: int, C: int, K: int):
    k = 0
    while A >= B:
        k += 1
        B *= 2
    while B >= C:
        k += 1
        C *= 2
    return YES if k <= K else NO

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
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
    print(solve(A, B, C, K))

def test():
    import doctest
    doctest.testmod()

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

Submission status: Accepted

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

while a >= b:
    k -= 1
    b *= 2
while b >= c:
    k -= 1
    c *= 2
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:
    cnt +=1
    b*=2
while b>=c:
    cnt += 1
    c*=2
print('Yes' if cnt<=k else '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:
abc=input("").split(" ")
a=int(abc[0])
b=int(abc[1])
c=int(abc[2])
k=int(input(""))
s=0
while(b<=a):
    s+=1
    b*=2
while(c<=b):
    s+=1
    c*=2
if(s<=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 a >= b:
    b *= 2
  else:
    c *= 2
  if a < b and b < c:
    print('Yes')
    break
else:
  print('No')

Submission status: Accepted

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

for k in range(K):
  #print(A, B, C)  
  if A >= B:
    B*=2
  else:
    C*=2


ans = False
if A < B < C:
  ans = True
  
print("Yes" if ans else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]

A, B, C = ri_()
K = ri()
cnt = 0
while 1:
    if A >= B:
        B *= 2
        cnt += 1
    elif B >= C:
        C *= 2
        cnt += 1
    else:
        break
print('Yes' if cnt <= K else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
k=int(input())
x=0
while b<=a:
    b=b<<1
    x+=1
while c<=b:
    c=c<<1
    x+=1
if x<=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+1):
    for j in range(k+1):
        if i+j > k:
            continue
        l = k-i-j
        A = a*(2**i)
        B = b*(2**j)
        C = c*(2**l)
        if A < B and B < C:
            print('Yes')
            exit()
else:
    print('No')

Submission status: Accepted

Solution code:
r, g, b = [int(i) for i in input().split()]
K = int(input())

# g 
cnt = 0
while g <= r:
  g *= 2
  cnt += 1
  
# b
while b <= g:
  b *= 2
  cnt += 1

  
if K < cnt:
  print("No")
else:
  print("Yes")

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
print("Yes" if cnt<=k else "No")

Submission status: Accepted

Solution code:
r, g, b = map(int, input().split())
k = int(input())
count = 0
while g <= r:
    g *= 2
    count += 1
while b <= g:
    b *= 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 _ in range(k):
    if c <= b or c <= a:
        c*=2
    elif b <= a:
        b*=2
        
    if a < b and b < c:
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


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


def readstrs():
    return input().split()


def main():
    A, B, C = readnums()
    K = readint()
    while K:
        if A >= B:
            B *= 2
            K -= 1
        elif B >= C:
            C *= 2
            K -= 1
        else:
            break

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import bisect
import sys
import math
from collections import deque
from heapq import heappush, heappop

def sRaw():
    return input().rstrip("\r")


def iRaw():
    return int(input())


def ssRaw():
    return input().split()


def isRaw():
    return list(map(int, ssRaw()))


INF = 1 << 29

DIV = (10**9) + 7
#DIV = 998244353

def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


def CONV_TBL(max, mod=DIV):
    fac, finv, inv = [0]*max, [0]*max, [0]*max
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, max):
        fac[i] = fac[i-1]*i % mod
        inv[i] = mod - inv[mod % i] * (mod//i) % mod
        finv[i] = finv[i-1]*inv[i] % mod

    class CONV:
        def __init__(self):
            self.fac = fac
            self.finv = finv
            pass

        def ncr(self, n, k):
            if(n < k):
                return 0
            if(n < 0 or k < 0):
                return 0
            return fac[n]*(finv[k]*finv[n-k] % DIV) % DIV

    return CONV()


def cumsum(As):
    s = 0
    for a in As:
        s += a
        yield s


sys.setrecursionlimit(200005)


def dijkstra(G,start=0):
    heap = []
    cost = [INF]*len(G)
    heappush(heap,(0,start))
    while len(heap)!=0:
        c,n = heappop(heap)
        if cost[n] !=INF:
            continue
        cost[n]=c
        for e in G[n]:
            ec,v = e
            if cost[v]!=INF:
                continue
            heappush(heap,(ec+c,v))
    return cost


def main():
    A,B,C = isRaw()
    K = iRaw()
    for k in range(K):
        if B<=A:
            B*=2
        else:
            C*=2
    if B>A and C>B:
        print("Yes")
    else:
        print("No")
main()

Submission status: Accepted

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    a, b, c = i_map()
    k = i_input()

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

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

    print('Yes' if count <=k else 'No')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import math
import bisect

def main():
    a, b, c = map(int, input().split())
    k = int(input())
    while b <= a and k > 0:
        b <<= 1
        k -= 1
    while c <= b and k > 0:
        c <<= 1
        k -= 1
    if a < b and b < c:
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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 *= 2
        continue
    if B >=C:
        C *= 2
        continue
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 True:
    if a >= b:
        b *= 2
        i += 1
    elif b >= c:
        c *= 2
        i += 1
    else:
        break
print("Yes" if i <= k else "No")

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 i <= K:
  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("No")
else:
    print("Yes")

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("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_s = lambda: readline().rstrip().decode('utf-8')
in_nl = lambda: list(map(int, readline().split()))
in_nl2 = lambda H: [in_nl() for _ in range(H)]
in_map = lambda: [s == ord('.') for s in readline() if s != ord('\n')]
in_map2 = lambda H: [in_map() for _ in range(H)]
in_all = lambda: map(int, read().split())


def main():

    A, B, C = in_nn()
    K = in_n()

    cnt = 0

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

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
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:
def main():
    a, b, c = map(int, input().split())
    k = int(input())
    f = False
    cnt = 0
    while b <= a:
        b *= 2
        cnt += 1
    while c <= b:
        c *= 2
        cnt += 1
    if cnt <= k:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque, Counter, OrderedDict
from bisect import bisect_left, bisect_right
from functools import reduce, lru_cache
from heapq import heappush, heappop, heapify

import itertools, bisect
import math, fractions
import sys, copy

def L(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline().rstrip())
def S(): return list(sys.stdin.readline().rstrip())
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return [list(x) for x in sys.stdin.readline().split()]
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def LIR1(n): return [LI1() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
def LR(n): return [L() for _ in range(n)]

alphabets = "abcdefghijklmnopqrstuvwxyz"

sys.setrecursionlimit(1000000)
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
MOD = 1000000007

def main():
    A, B, C = LI()
    K = I()

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import collections
import decimal
import itertools
from collections import deque
from functools import reduce
import heapq
import copy
#x = int(input())
a, b, c = map(int, sys.stdin.readline().split())
#s = input()
#a = list(map(int, sys.stdin.readline().split()))

k = int(input())

d = 0
while (True):
    if b > a:
        break
    else:
        b *= 2
        d += 1

while (True):
    if c > b:
        break
    else:
        c *= 2
        d += 1

if d <= 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 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())
i = 0

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

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

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