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: Runtime Error

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

for i in range(1,k):
    a[-1] *= 2

    if(a[-1] > a[-2]):
        break
    else:
        continue
for j in range(1,k-i+1):
    a[-2] *= 2

if(a[-2] > a[-3]):
    print("Yes")
else:
    print("No")
print(i)

Submission status: Runtime Error

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

for i in range(1,k):
    a[-1] *= 2
    print(a[-1])
    if(a[-1] > a[-2]):
        break
    else:
        continue
for j in range(1,k-i+1):
    a[-2] *= 2
    print(a[-2])
if(a[-2] > a[-3]):
    print("Yes")
else:
    print("No")
print(i)

Submission status: Runtime Error

Solution code:
a = 0
for i in range(K):
  if C > B and B > A:
    print("Yes")
    a = 1
  else:
    if A <= B:
      B = 2*B
      K = K+1
    elif C <= B:
      C = 2*C
      K = K+1
 
if a == 0:
  print("No")

Submission status: Runtime Error

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

for i in range(K):

    if B >= A :
        B *= 2
    else:
        C *= 2
    if B > A 
        if C > B:
            print("Yes")
            break
print("No")

Submission status: Runtime Error

Solution code:
7 4 2
3

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
A,B,C = map(int, input().split())
K = int(input())
if A < B:
  K1 = math.ceil(math.log(A,B))
  B = B ** K1
else if A == B:
  K1 = 2;
  B = B ** K1
else
  K1 = 1;

if B < C:
  K2 = math.ceil(math.log(B,C))
else if B == C:
  K2= 2;
else
  K2= 1;
if K1 + K2 -2 <= K:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

    while(K > 0):
        if green <= red:
            green *= 2
            K -= 1
            continue
        if blue <= green:
            blue *= 2
            K -= 1
            continue
        if judge(red, green, blue):
            break
        
    if judge(red, green, blue):
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys

sys.setrecursionlimit(10**6)

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

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

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

ans = 'No'

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

Submission status: Runtime Error

Solution code:
a = list(map(int,input().split()))
k = int(input())
#青＞緑＞赤
r,g,b = 0,0,0
for i,num in enumerate(a):
    if i==0:
        r = num
    elif i==1:
        g = num
    elif i==2:
        b = num

for i in range(k):
    if g<r:
        g *= 2
        count += 1
    elif b<g:
        b *= 2
        count += 1
    
    if b>g and g>r:
        break

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
card=input().split()
k=int(input())
arr=[]
for i in range(k):
   res=int(arr[i])*2 
if arr[0]<arr[1]<arr[2]:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
if K <= 0:
  return
for i in range(K):
  if C > B and B > A:
    print(Yes)
    return
  else:
    if A <= B:
      B = 2*B
      K = K+1
    elif C <= B:
      C = 2*C
      K = K+1
 
print(No)
return

Submission status: Runtime Error

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


for i in range(1:K+1):
  B=B*2
  if (B>A)&(C>B):
    print("Yes")
  else :
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main(){
  int R,G,B,K,i=0;cin>>R>>G>>B>>K;
  if(B>G&&G>R){
    cout<<"Yes"<<endl;
    return 0;
  }
  else{
    while(G<=R){
      G*=2;i++;
    }
    while(B<=G){
      B*=2;i++;
    }
    cout<<(i>K?"No":"Yes")<<endl;
  }
}

Submission status: Runtime Error

Solution code:
import sys

sys.setrecursionlimit(10**6)

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

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

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

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

Submission status: Runtime Error

Solution code:
for i in range(K):
  if C > B and B > A:
    print(Yes)
    return
  else:
    if A <= B:
      B = 2*B
      K = K+1
    elif C <= B:
      C = 2*C
      K = K+1

print(No)
return

Submission status: Runtime Error

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

k = n

if a < b < c:
    print('Yes')
    break

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: Runtime Error

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

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

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

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

Submission status: Runtime Error

Solution code:
import sys
import itertools
import copy
ORG=map(int, sys.stdin.readline().split())
K=int(sys.stdin.readline().strip())
L=list( itertools.product(range(3), repeat=K) )

for x in L:
    ABC=copy.deepcopy(ORG)
    ABC[x[0]]*=2
    ABC[x[1]]*=2
    ABC[x[2]]*=2
    if ABC[0]<ABC[1]<ABC[2]:
        print "Yes"
        quit()
else:
    print "No"

Submission status: Runtime Error

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

N = int(input())

for i in range(N):
  if A > B:
    B = int(2*B)
  elif B > C:
    C = int(2*C)
  if A < B < C:
    flag = True
    break

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

Solution code:
A, B, C, K = input(), input(), input(), input()

for i in range(K):
  if C > B and B > A:
    print(Yes)
    return
  else:
    if B <= A:
      B = 2*B
      K = K+1
      
    elif C <= B:
      C = 2*C
      K = K+1
      
print(No)
return

Submission status: Runtime Error

Solution code:
7 2 5
3

Submission status: Runtime Error

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_flgw and b_c_flg:
    print('Yes')
    break
if not (a_b_flgw and b_c_flg):
  print('No')

Submission status: Runtime Error

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_flgw and b_c_flg:
    print('Yes')
    break
if not (a_b_flgw and b_c_flg):
  print('No')

Submission status: Runtime Error

Solution code:
[a, b, c] = [x for x in map(int, 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_flgw and b_c_flg:
    print('Yes')
    break
if not (a_b_flgw and b_c_flg):
  print('No')

Submission status: Runtime Error

Solution code:
[a, b, c] = [x for x in map(int, 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_flgw and b_c_flg:
    print('Yes')
    break
if not (a_b_flgw and b_c_flg):
  print('No')

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

A,B,C=map(int,input().split())
K=map(int,input().split())
while A<=B:
    B*=2
    K-=1
while B<=C:
    C*=2
    K-=1
print(K>=0)

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
#define mp make_pair
#define fi first
#define se second
#define VAL 100000
#define ll  long long 
#define INF 10000000000000000LL
#define pll pair<long long , long long>
const int MAX=2e5+9;
const ll MOD=1e9+7;
const int TOT_PRIMES=19;
const int MAX_A=70;
using namespace std;
int pexp[MAX];
int main() 
{

	ios_base::sync_with_stdio(false); 
    cin.tie(NULL);  
    int a, b, c;
    cin>>a>>b>>c;
    int k;
    cin>>k;
    int tot=0;
    while(c<=b){
    	c=c*2;
    	tot=tot+1;
    }
    while(c<=a)
    {
    	c=c*2;
    	tot=tot+1;
    }
    while(b<=a){
    	b=b*2;
    	tot=tot+1;
    }
    while(c<=b)
    {
    	c=c*2;
    	tot=tot+1;
    }
   // cout<<tot;
   // cout<<a<<b<<c;
    if(tot>k)
    	cout<<"No";
    else
    	cout<<"Yes";

}

Submission status: Runtime Error

Solution code:
li = int(input().split())
a=int(input())
magic = 0
for i in range(0,3):
    if li[0] >= li[1]:
        li[1] = li[1] * 2
        magic = magic + 1

for i in range(0,3):
    if li[1] >= li[2]:
        li[2] = li[2] * 2
        magic = magic + 1
if a >= magic:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

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

for j in range(K - Ak):
    if B > C:
        C = C * 2

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

Submission status: Runtime Error

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

if a<b and b<c:
  print("Yse")

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for _ in range(k):
    if b < a:
        b = 2 * b
        continue
    if c < b:
        c = 2 * c
        continue
    print('Yes')
    sys.exit()
print('No')

Submission status: Runtime Error

Solution code:
A,B,C = map(int,input())
K = int(input())
if A > (B + C):
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
while B <= A:
    B = B * 2
    N = N + 1

while C <= B:
    C = C * 2
    N = N + 1

if K >= N:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
A,B,C = map(int, input().split())
K = int(input())
K1 = math.ceil(math.log(A,B))
B = B ** K1
K2 = math.ceil(math.log(B,C))
if K1 + K2 -2 <= K:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

ans = False

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

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

Submission status: Runtime Error

Solution code:

a, b, c = 7, 4, 2
k = int(input())

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

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

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
K=int(input())
if a>=b:
  for i in range(3):
    b=b*2
    if b>a:
      A=i+1
      break
else:
  A=0
if b>=c:
  for j in range(3):
    c=c*2
    if c>b:
      n=j+1
      break
else:
  n=0
if A+n<=K:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
from itertools import product
def solve():
    card_org = list(map(int,input().split()))
    K = int(input())
    comb = list(product(range(3), repeat=K))

    for c in comb:
        card = card_org[:]
        for i in range(3):
            card[c[i]] *= 2
        
        if card[1] > card[0] and card[2] > card[1]:
            print('Yes')
            return
    
    print('No')

if __name__ == '__main__':
    solve()

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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:
    pirnt("Yes")

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using vi = vector<int>;
using vv = vector<vi>;
using P  = pair<int,int>;
using T  = tuple<int,int,int>;

int main(void){
    int a,b,c;
    cin>>a>>b>>c;
    
    int k;cin>>k;
    
    while(a>=b && k>0){
        b *= 2;
        k--;
    }
    
    while(b>=c && k>0){
        c*= 2;
        k--;
    }
    
    if(a<b && b<c)
        cout<<"Yes" <<endl;
    else
        cout<<"No" <<endl;
    
    return 0;
}

Submission status: Runtime Error

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