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:
"""
    Satwik_Tiwari ;) .
    24th july , 2020  - Friday
"""

#===============================================================================================
#importing some useful libraries.
from __future__ import division, print_function

from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase

from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter  # Counter(list)  return a dict with {key: count}
from itertools import combinations as comb # if a = [1,2,3] then print(list(comb(a,2))) -----> [(1, 2), (1, 3), (2, 3)]
from itertools import permutations as permutate
from bisect import bisect_left as bl
#If the element is already present in the list,
# the left most position where element has to be inserted is returned.
from bisect import bisect_right as br
from bisect import bisect
#If the element is already present in the list,
# the right most position where element has to be inserted is returned

#==============================================================================================
#fast I/O region
BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

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

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

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

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


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


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

# inp = lambda: sys.stdin.readline().rstrip("\r\n")

#===============================================================================================
#some shortcuts

mod = 1000000007
def inp(): return sys.stdin.readline().rstrip("\r\n") #for fast input
def out(var): sys.stdout.write(str(var))  #for fast output, always take string
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())
# def graph(vertex): return [[] for i in range(0,vertex+1)]
def zerolist(n): return [0]*n
def nextline(): out("\n")  #as stdout.write always print sring.
def testcase(t):
    for p in range(t):
        solve()
def printlist(a) :
    for p in range(0,len(a)):
        out(str(a[p]) + ' ')
def lcm(a,b): return (a*b)//gcd(a,b)
def power(a,b):
    ans = 1
    while(b>0):
        if(b%2==1):
            ans*=a
        a*=a
        b//=2
    return ans
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))
def isPrime(n) :
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

#===============================================================================================
# code here ;))

def rec(a,b,c,k):
    if(a<b<c):
        # print(a,b,c)
        return True


    if(k>0):
        a1 = rec(a*2,b,c,k-1)
        a2 = rec(a,b,c*2,k-1)
        a3 = rec(a,b*2,c,k-1)
        return a1 or a2 or a3
    else:
        return False

# print(temp)
def solve():
    a,b,c = sep()
    k = int(inp())
    if(rec(a,b,c,k)):
        print('Yes')
    else:
        print('No')



testcase(1)
# testcase(int(inp()))

Submission status: Accepted

Solution code:
"""
    Satwik_Tiwari ;) .
    24th july , 2020  - Friday
"""

#===============================================================================================
#importing some useful libraries.
from __future__ import division, print_function

from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase

from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter  # Counter(list)  return a dict with {key: count}
from itertools import combinations as comb # if a = [1,2,3] then print(list(comb(a,2))) -----> [(1, 2), (1, 3), (2, 3)]
from itertools import permutations as permutate
from bisect import bisect_left as bl
#If the element is already present in the list,
# the left most position where element has to be inserted is returned.
from bisect import bisect_right as br
from bisect import bisect
#If the element is already present in the list,
# the right most position where element has to be inserted is returned

#==============================================================================================
#fast I/O region
BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

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

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

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

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


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


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

# inp = lambda: sys.stdin.readline().rstrip("\r\n")

#===============================================================================================
#some shortcuts

mod = 1000000007
def inp(): return sys.stdin.readline().rstrip("\r\n") #for fast input
def out(var): sys.stdout.write(str(var))  #for fast output, always take string
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())
# def graph(vertex): return [[] for i in range(0,vertex+1)]
def zerolist(n): return [0]*n
def nextline(): out("\n")  #as stdout.write always print sring.
def testcase(t):
    for p in range(t):
        solve()
def printlist(a) :
    for p in range(0,len(a)):
        out(str(a[p]) + ' ')
def lcm(a,b): return (a*b)//gcd(a,b)
def power(a,b):
    ans = 1
    while(b>0):
        if(b%2==1):
            ans*=a
        a*=a
        b//=2
    return ans
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))
def isPrime(n) :
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

#===============================================================================================
# code here ;))

def rec(a,b,c,k):
    if(a<b<c):
        # print(a,b,c)
        return True


    if(k>0):
        a1 = rec(a*2,b,c,k-1)
        a2 = rec(a,b,c*2,k-1)
        a3 = rec(a,b*2,c,k-1)

        return a1 or a2 or a3

# print(temp)
def solve():
    a,b,c = sep()
    k = int(inp())
    if(rec(a,b,c,k)):
        print('Yes')
    else:
        print('No')



testcase(1)
# testcase(int(inp()))

Submission status: Accepted

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

ptrn = ["A","B","C"]
for k in range(1,K):
  plen = len(ptrn)
  for i in range(plen) :
    wptrn = ptrn.pop(0)
    ptrn.append( wptrn + "A") 
    ptrn.append( wptrn + "B")
    ptrn.append( wptrn + "C")
    
flg = False    
for p in ptrn :
  plist = list(p)
  a = A
  b = B
  c = C
  for q in plist:
    if q == 'A':
      a *= 2
    elif q == 'B':
      b *= 2
    else:
      c *= 2
  if a < b and b < c:
    flg = True
    
print("Yes" if flg else "No")

Submission status: Accepted

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

Submission status: Accepted

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

flag = "No"
for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if x + y + z <= K and A*(2**x) < B*(2**y) and B*(2**y) < C*(2**z):
                flag = "Yes"
print(flag)

Submission status: Accepted

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

Submission status: Accepted

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

i = 0
while(1):
    if b>a: break
    b*=2
    i+=1
    if i>k: break

while(1):
    if c>b: break
    c*=2
    i+=1
    if i>k: break

if i>k:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

read = sys.stdin.buffer.read

a, b, c, k = map(int, read().split())
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:
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

read = sys.stdin.buffer.read

a, b, c, k = map(int, read().split())
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 = 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())

# 貪欲法による解法
"""
Aは小さいほうが嬉しいので、操作をする必要はありません。
BはAAより大きくないといけないので、A≥Bである限り操作をする必要があります。
Cも同様にB≥Cである限り操作をする必要があります。
最低何回の操作で目的を達成できるか、実際に操作をシミュレートしてカウントします。
その後、KK回以内であるか判定すればいいです。
"""
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,k=map(int,open(0).read().split())
while k:k-=1;t=a<b;b*=2-t;c*=1+t
print('NYoe s'[b<c::2])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
s = int(input())
f = 0
for i in range(s+1):
  for j in range(0,s-i+1):
    for k in range(0,s-i-j+1):
      if i+j+k != s:
        continue
      else:
        A = a*(2**i)
        B = b*(2**j)
        C = c*(2**k)
        if A < B and B < C:
          f += 1
if f == 0:
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B - Magic 2
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('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
A,B,C = [int(x) for x in input().split()]
K=int(input())
 
while(A>=B and K>0):
  B=B*2
  K-=1
 
while(B>=C and K>0):
  C=C*2
  K-=1

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

Submission status: Accepted

Solution code:
import math  # noqa: F401
from collections import deque  # noqa: F401
from typing import Deque, Dict, List, Optional, Tuple, Union  # noqa: F401


def main(A: int, B: int, C: int, K: int):
    for _ in range(K):
        if A >= B:
            B *= 2
            continue
        if B >= C:
            C *= 2

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


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

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

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:
def calc():
    abc = list(map(int, input().split()))
    k = int(input())
    for i in range(0, 7):
        for j in range(0, 7):
            for l in range(0, 7):
                sum = i+j+l
                con1 = sum <= k
                con2 = abc[0]*(1 << i) < abc[1]*(1 << j)
                con3 = abc[1]*(1 << j) < abc[2]*(1 << l)
                if(con1 & con2 & con3):
                    print('Yes')
                    return
    print('No')
    return


calc()

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:
from math import log2,ceil
a,b,c=map(int,input().split())
k=int(input())
n=0
while b<=a:
    b*=2
    n+=1
while c<=b:
    c*=2
    n+=1
if n<=k:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# B - Magic 2
def main():
    A, B, C, K = map(int, open(0).read().split())
    for _ in range(K):
        if A >= B:
            B *= 2
        else:
            C *= 2
    print("Yes" if A < B < C else "No")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    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 < c):
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

while R >= G:
    G *= 2
    K -= 1

while G >= B:
    B *= 2
    K -= 1

print('Yes' if K >= 0 else 'No')

Submission status: Accepted

Solution code:
r, g, b = map(int, input().split())
K = int(input())
for i in range(K+1):
    for j in range(K+1-i):
        for k in range(K+1-i-j):
            rr, gg, bb = r * (1<<i), g * (1<<j), b * (1<<k)
            if rr < gg < bb:
                print('Yes')
                exit()
print('No')

Submission status: Accepted

Solution code:
from sys import stdin
input = stdin.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

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

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
num = int(input())
k = 0
for i in range(num):    #num回２倍を繰り返す。でなければNoをprint
  if a[0] == max(a) or a[1] == max(a):   #リストaの中のmaxよりも青が小さいならば青を二倍する
    a[2] = a[2] * 2
    k += 1
  elif a[1] == min(a) and k < num:
    a[1] = a[1] * 2
    k += 1 
  else:
    pass

if a[0] < a[1] and a[1] < a[2]:
  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=map(int, input().split())
k=int(input())
ans="No"
d=0
for i in range(k+1):
    b2=b*(2**(k-d))
    c2=c*(2**(d))
    if(a<b2<c2):
        ans="Yes"
    d+=1
print(ans)

Submission status: Accepted

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

cnt = 0

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

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

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

Submission status: Accepted

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

for p in range(8):
    for q in range(8):
        for r in range(8):
            if A * 2 ** p < B * 2 ** q < C * 2 ** r and p + q + r <= K:
                flag = True

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

Submission status: Accepted

Solution code:
import math  # noqa: F401
from collections import deque  # noqa: F401
from typing import Deque, Dict, List, Optional, Tuple, Union  # noqa: F401


def main(A: int, B: int, C: int, K: int):
    for _ in range(K):
        if A >= B:
            B *= 2
            continue
        if B >= C:
            C *= 2

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


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

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:
r, g, b = map(int, input().split())
k = int(input())

def dfs(i , r, g, b):
    if i > k: return False
    if r < g < b: return True
    if dfs(i+1, r*2, g,   b  ): return True
    if dfs(i+1, r,   g*2, b  ): return True
    if dfs(i+1, r,   g,   b*2): return True
    return False

print('Yes' if dfs(0, r, g, b) else 'No')

Submission status: Accepted

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

    op = 0
    while not (a < b and b < c):
        if not a < b:
            b *= 2
            op += 1
        elif not b < c:
            c *= 2
            op += 1

    if op <= 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())
count = 0
while a >= b:
  count += 1
  b *= 2
while b >= c:
  count += 1
  c *= 2
print(['No','Yes'][count<=k])

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

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

Submission status: Accepted

Solution code:
a, b, c= map(int, input().split())
num= int(input())
for x in range(num):
    if a >= b and c >= a:
        b=b*2
    else:
        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())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

A, B, C = mi()
N = ii()

cnt = 0

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

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

if cnt <= N:
    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:
    count+=1;b*=2
while b>=c:
    count+=1;c*=2
print(['No','Yes'][count<=k])

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
num = int(input())
k = 0
for i in range(num):    #num回２倍を繰り返す。でなければNoをprint
  if a[0] == max(a) or a[1] == max(a):   #リストaの中のmaxよりも青が小さいならば青を二倍する
    a[2] = a[2] * 2
    k += 1
  elif a[1] == min(a) and k < num:
    a[1] = a[1] * 2
    k += 1 
  else:
    pass

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

Submission status: Accepted

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


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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

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

ans = 'No'
cnt = 0
while A >= B:
    B = B * 2
    cnt += 1
while B >= C:
    C = C * 2
    cnt += 1

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

Submission status: Accepted

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


def combinations(k):
    result = []
    for b in range(k + 1):
        for c in range(k + 1 - b):
            result.append([b, c])

    return result


def magic(A, B, C, K):
    if A < B < C:
        return True

    for b_count, c_count in combinations(K):
        a, b, c = A, B, C
        if b_count > 0:
            b *= 2 ** b_count
        if c_count > 0:
            c *= 2 ** c_count

        if a < b < c:
            return True

    return False


if (magic(A, B, C, K)):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

if a < b and b < c:
    flag = True

print("Yes") if flag else print("No")

Submission status: Accepted

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


def combinations(k):
    result = []
    for b in range(k + 1):
        for c in range(k + 1 - b):
            result.append([b, c])

    return result


def magic(A, B, C, K):
    if A < B < C:
        return True

    for l in combinations(K):
        a, b, c = A, B, C
        b_count, c_count = l
        if b_count > 0:
            b *= 2 ** b_count
        if c_count > 0:
            c *= 2 ** c_count

        if a < b < c:
            return True

    return False


if (magic(A, B, C, 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
    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())
i = 0
while A >= B:
  B *= 2
  i += 1
while B >= C:
  C *= 2
  i += 1
if i > K:
  print("No")
else:
  print("Yes")

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 = map(int, input().split())
k = int(input())

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
def main():
    R, G, B = map(int, input().split())
    K = int(input())

    for i in range(K):
        if R >= G:
            G = G * 2
        else:
            if G >= B:
                B = B * 2
        if B > G > R:
            print("Yes")
            exit()
    print("No")
if __name__  == '__main__':
    main()

Submission status: Accepted

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

K = int(input())

flag = False

for i in range(0, K+1):
    for j in range(0, K+1):
        for k in range(0, K+1):
            x = A * 2**i
            y = B * 2**j
            z = C * 2**k
            # print(x, y, z)

            if x < y < z and i + j + k <= K:
                flag = True


if flag == True:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
a = list(map(int, input().split()))
k = int(input())
ans = 0
for it in range(3 ** k):
    i = it
    # a_i = a #　こうするとa も変更される
    a_i = [a[0], a[1], a[2]]
    cnt = 0
    while cnt < k:
        j = i % 3
        i //= 3
        # 選ぶのはa_i[j]
        a_i[j] *= 2
        cnt += 1
        if cnt == k:
            # print(a_i)
            if a_i[0] < a_i[1] and a_i[1] < a_i[2]:
                ans += 1
if ans > 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
lst = input().split()
A = int(lst[0])
B = int(lst[1])
C = int(lst[2])

K = int(input())

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

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

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
k=int(input())
for i in range(0,k+1):
  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())
t = 0
while(a>=b):b*=2;t+=1
while(b>=c):c*=2;t+=1
if(t <= k):print("Yes")
else:print("No")