Harryxun/stf_run huggingface dataset:
n = int(input())
INF = 10**9
P = []
for i in range(n):
    p = map(int, input().split())
    P.append()
m = [[0]*n for i in range(n)]

for l in range(2, n + 1):
    for i in range(n - l + 1):
        j = i + l - 1
        m[i][j] = INF
        for k in range(i, j):
            m[i][j] = min(m[i][j], m[i][k] + m[k + 1]m[j] + p[i - 1] * p[k] * p[j])

print(m[0][n - 1])

### FIXED CODE ###

n = int(input())
INF = 10**9
P = [list(map(int, input().split())) for i in range(n)]
m = [[0]*n for i in range(n)]

for l in range(2, n + 1):
    for i in range(n - l + 1):
        j = i + l - 1
        m[i][j] = INF
        for k in range(i, j):
            m[i][j] = min(m[i][j], m[i][k] + m[k + 1][j] + P[i][0] * P[k][1] * P[j][1])

print(m[0][n - 1])
N,M = map(int,input().split())
p_s = [tuple(input().split()) for _ in range(M)]

wa_score = [0]*N
ac_flg = [0]*N

for p,s in p_s:
    p = int(p)
    if s == 'AC':
        ac_flg[p-1] = 1
    else:
        if ac_flg[p-1] == 0:
            wa_score[p-1] += 1

ac_count = sum(ac_flg)
wa_count = 0
for i in ac_flg:
    if i == 1:
        wa_count += wa_score[i]

print(ac_count,wa_count)

### FIXED CODE ###

N,M = map(int,input().split())
p_s = [tuple(input().split()) for _ in range(M)]

wa_total = [0]*N
wa_count = [0]*N 
ac_flg = [False]*N

for p,s in p_s:
    p = int(p)-1
    if not ac_flg[p]:
        if s == 'AC':
            ac_flg[p] = True
            wa_count[p] = wa_total[p]
        else:
            wa_total[p] += 1

print(ac_flg.count(True),sum(wa_count))
import sys
import math
import numpy as np


MOD=998244353
N=int(input())
a=[int(input()) for i in range(N)]
a.sort(reverse=True)

A=sum(a)
M=math.ceil(A/2)  
x =[ [0 for j in range(M+1)] for i in range(N)]
x[0][0]=2
x[0][min(a[0],M)]=1

p=M-A+a[0]
q=a[0]
for i in range(1,N):
    p+=a[i]
    q+=a[i]
    for j in range(max(p,0),min(q,M)+1):
        if j==M:
            x[i][j]=sum(x[i-1][ max(M-a[i],0): M ])+x[i-1][M]*3

        elif j-a[i]<0: x[i][j]=x[i-1][j]*2
        else: x[i][j]=x[i-1][j]*2+x[i-1][j-a[i]]

        x[i][j]%=MOD

if sum(a)%2==0:
    y =[ [0 for j in range(M+1)] for i in range(N)]
    y[0][0]=1
    p=M-A+a[0]
    q=a[0]
    for i in range(1,N):
        p+=a[i]
        q+=a[i]
        for j in range(max(p,0),min(q,M)+1):
            if j-a[i]<0: y[i][j]=y[i-1][j]
            else: y[i][j]=y[i-1][j]+y[i-1][j-a[i]]

            y[i][j]%=MOD

    ans=3**N-x[N-1][M]*3+y[N-1][M]*6



else: ans=3**N-x[N-1][M]*3
print(ans%MOD)


### FIXED CODE ###

n=int(input())
a=[int(input()) for _ in range(n)]
mod=998244353
s=sum(a)

dp=[[0]*(s+1) for _ in range(n)]
dp[0][0],dp[0][a[0]]=2,1
for i in range(n-1):
    for j in range(s+1):
        dp[i+1][j]=(dp[i+1][j]+dp[i][j]*2)%mod
        if j+a[i+1]<=s: dp[i+1][j+a[i+1]]=(dp[i+1][j+a[i+1]]+dp[i][j])%mod

dp2=[[0]*(s+1) for _ in range(n)]
dp2[0][0]=1;dp2[0][a[0]]=1
for i in range(n-1):
    for j in range(s+1):
        dp2[i+1][j]=(dp2[i+1][j]+dp2[i][j])%mod
        if j+a[i+1]<=s: dp2[i+1][j+a[i+1]]=(dp2[i+1][j+a[i+1]]+dp2[i][j])%mod

if s%2==0:
    inable=( sum(dp[n-1][s//2:]) - dp2[n-1][s//2] )*3%mod
else:
    inable=( sum(dp[n-1][s//2+1:]) )*3 %mod

ans=1
for _ in range(n):
    ans=ans*3%mod
ans=(ans-inable)%mod
print(ans)
#最大公約数を求める再帰関数-->計算量O(log(max(x))
def gcd(x, y):
    if x < y:
        x, y = y, x
    if y == 0:
        return x
    return gcd(x-y, y)


#本文
N = int(input())
list_A = list(map(int, input().split()))

#配列初期化
list_gcd = [0] * N
list_gcd_rev = [0] * N

#配列の最初のgcdを求める。定義
list_gcd[0] = list_A[0]
list_gcd_rev[N-1] = list_A[N-1]
#print (list_gcd, list_gcd_rev)

#配列にgcdを代入していく
for i in range(1,N):
    list_gcd[i] = gcd(list_gcd[i-1], list_A[i])
#print (list_gcd)
for j in range(1,N):
    list_gcd_rev[N-1-j] = gcd(list_gcd_rev[N-j], list_A[N-1-j])
#print (list_gcd_rev)

#print (list_gcd, list_gcd_rev)

#k番目までの両端からのgcdを求める
if N == 2:
    ans = gcd(list_gcd[0], list_gcd_rev[1])
else:
    ans = max(list_gcd[N-2], list_gcd_rev[1]) #両端の文字を除いたときの答え
#print (ans)
for k in range(1,N-1):
    a = list_gcd[k-1]
    b = list_gcd_rev[k+1]
    ans = max(ans, gcd(a, b))
print (ans)

### FIXED CODE ###

#最大公約数を求める再帰関数-->計算量O(log(max(x))
def gcd1(x, y):
    if x < y:
        x, y = y, x
    if y == 0:
        return x
    return gcd(x-y, y)

def gcd(x,y):
    if x<y:
        x,y=y,x
    #x>y
    if y==0:
        return x
    if x%y==0:
        return y
    else:
        return gcd(y,x%y)


#本文
N = int(input())
list_A = list(map(int, input().split()))

#配列初期化
list_gcd = [0] * N
list_gcd_rev = [0] * N

#以下　間違いを発見できず

##配列の最初のgcdを求める。定義
#list_gcd[0] = list_A[0]
#list_gcd_rev[N-1] = list_A[N-1]
##print (list_gcd, list_gcd_rev)

##配列にgcdを代入していく
#for i in range(1,N):
#    list_gcd[i] = gcd(list_gcd[i-1], list_A[i])
##print (list_gcd)
#for j in range(1,N):
#    list_gcd_rev[N-1-j] = gcd(list_gcd_rev[N-j], list_A[N-1-j])
##print (list_gcd_rev)

##print (list_gcd, list_gcd_rev)

##k番目までの両端からのgcdを求める
#if N == 2:
#    ans = gcd(list_gcd[0], list_gcd_rev[1])
#else:
#    ans = max(list_gcd[N-2], list_gcd_rev[1]) #両端の文字を除いたときの答え
##print (ans)
#for k in range(1,N-1):
#    a = list_gcd[k-1]
#    b = list_gcd_rev[k+1]
#    ans = max(ans, gcd(a, b))
#print (ans)

#以下、正答

for i in range(1,N):
    list_gcd[i]=gcd(list_gcd[i-1],list_A[i-1])
for i in range(N-1)[::-1]:
    list_gcd_rev[i]=gcd(list_gcd_rev[i+1],list_A[i+1])
Z = [gcd(list_gcd[i], list_gcd_rev[i]) for i in range(N)]
print (max(Z))
import sys
readline=sys.stdin.readline
n=int(readline())
aa=list(map(int,readline().split()))
laa=len(aa)
cnt=[0]*(10**5+3)
for i in range(laa):
  if i > 0:
    aa[i-1]+=1
  aa[i]+=1
  aa[i+1]+=1

ans=0

for _ in aa:
  ans=max(ans,_)

print(ans)

### FIXED CODE ###

import sys
readline=sys.stdin.readline
n=int(readline())
aa=list(map(int,readline().split()))
laa=len(aa)
cnt=[0]*(10**5+2)
for n in range(laa):
  i=aa[n]
  if i > 0:
    cnt[i-1]+=1
  cnt[i]+=1
  cnt[i+1]+=1

ans=0

for _ in cnt:
  ans=max(ans,_)

print(ans)
class Dice:
    def __init__(self):
        self.dice=[1,2,3,4,5,6] # up,front,right,left,back,front
    def set(self,l):
        self.dice=l
    def roll(self, s):
        import copy
        mat=((1,4,3,2),(5,0,1,1),(2,2,0,5),(3,3,5,0),(0,5,4,4),(4,1,2,3))
        l=copy.deepcopy(self.dice)
        if s == 'N': c = 0
        if s == 'S': c = 1
        if s == 'E': c = 2
        if s == 'W': c = 3
        for i in range(6):
            print('i=%d, c=%d, mat[i][c]=%d, %d->%d'%(i,c,mat[i][c],self.dice[i],l[mat[i][c]]))
            self.dice[i]=l[mat[i][c]]
    def get(self):
        return self.dice

d=Dice()
d.set(list(map(int,input().split)))
s=input()
for i in range(len(s)):
    d.roll(s[i])
print(d.get()[0])

### FIXED CODE ###

class Dice:
    def __init__(self):
        self.dice=[1,2,3,4,5,6] # up,front,right,left,back,front
    def set(self,l):
        self.dice=l
    def roll(self, s):
        import copy
        mat=((1,4,3,2),(5,0,1,1),(2,2,0,5),(3,3,5,0),(0,5,4,4),(4,1,2,3))
        l=copy.deepcopy(self.dice)
        if s == 'N': c = 0
        if s == 'S': c = 1
        if s == 'E': c = 2
        if s == 'W': c = 3
        for i in range(6):
            self.dice[i]=l[mat[i][c]]
    def get(self):
        return self.dice

d=Dice()
d.set(list(map(int,input().split())))
s=input()
for i in range(len(s)):
    d.roll(s[i])
print(d.get()[0])
N,M = map(int,input().split())

a = [int(input()) for i in range(M)]
a.reverse()
wa = (10**9) + 7

#dpを使う

dp = [0]*(N+1)
dp[0]=1
now_a = a.pop()
for i in range(1,N+1):
    if i==1:
        dp[i]=dp[i-1]
    else:
        dp[i]=dp[i-1] + dp[i-2]
    if i == now_a:
        dp[i]=0
        if len(a)!=0:
            now_a = a.pop()
        else:
            now_a = -1

print(dp[N]%wa)





### FIXED CODE ###

N,M = map(int,input().split())

a = [int(input()) for i in range(M)]

wa = (10**9) + 7

#dpを使う

dp = [0]*(N+1)
dp[0]=1
now_a = 0
if len(a)==0:
    now_a = -1
if len(a)!=0:
    a.reverse()
    now_a = a.pop()

for i in range(1,N+1):
    # print(now_a)
    if i==1:
        dp[i]=dp[i-1]
    else:
        dp[i]=dp[i-1] + dp[i-2]
    if i == now_a:
        dp[i]=0
        if len(a)!=0:
            now_a = a.pop()
        else:
            now_a = -1

# print(dp)

print(dp[N]%wa)
#D
import sys
sys.setrecursionlimit(200000)

n, m = list(map(int, input().split()))
alist = list(map(int, input().split()))
alist.sort()

def inserter(key, list1) :
    if list1 == [] :
        return [key]
    elif list1[0][1] < key[1] :
        return [key] + list1
    else :
        return [list1[0]] + inserter(key, list1[1:])
def rewriter(list1, list2) :
    if list1 == [] :
        return []
    elif list2 == [] :
        return list1
    else :
        return [max(list1[0], list2[0])] + rewriter(list1[1:], list2[1:])
    
bclist = []
for i in range(m) :
    bc = list(map(int, input().split()))
    bclist = inserter(bc, bclist)
rwlist = []
for j in len(bclist) :
    if j < len(alist) :
        rwlist += [j[1]] * j[0]
    else :
        break
ans = rewriter(alist, rwlist)
print(sum(ans))

### FIXED CODE ###

from operator import itemgetter

n, m = map(int, input().split())
aa = list(map(int, input().split()))
bcbc = [list(map(int, input().split())) for _ in range(m)]
bcbc.extend([[1, a] for a in aa])
bcbc.sort(key=itemgetter(1), reverse=True)

count = 0
s = 0
for b, c in bcbc :
    if count + b >= n :
        b = n - count
    count += b
    s += b*c
    if count == n :
        break
print(s)
n = input()
k=0
for i in range(10):
  if n.count(str(i))>=3:
    print("Yes")
    k=1
    break
if k=0:
  print("No")
  
   


### FIXED CODE ###

n = input()
if n[0]==n[1] and n[1]==n[2]:
  print("Yes")
elif n[1]==n[2] and n[2]==n[3]:
  print("Yes")
else:
  print("No")
import itertools
import numpy as np
import math

n, p = map(int, input().split())
if n != 1:
    table = [0] * (math.sqrt(p) + 1)

    pl = []
    ans = 1

    for i in range(2, math.sqrt(p)+1):
        if table[i] == 0:
            pl.append(i)
            for j in range(i + i, p + 3, i):
                table[j] = 1

    a = 0

    for i in range(len(pl)):
        q = p
        while q % pl[i] == 0:
            a += 1
            q = q / pl[i]
        ans = ans * (pl[i] ** (int(a//n)))
        a = 0
else:
    ans = p
print(ans)

### FIXED CODE ###

import itertools
import numpy as np
import math

n, p = map(int, input().split())
if n != 1:
    table = [0] * (int(math.sqrt(p)) + 1)

    pl = []
    ans = 1

    for i in range(2, int(math.sqrt(p)) + 1):
        if table[i] == 0:
            pl.append(i)
            for j in range(i + i, int(math.sqrt(p)) + 1, i):
                table[j] = 1

    a = 0

    for i in range(len(pl)):
        q = p
        while q % pl[i] == 0:
            a += 1
            q = q / pl[i]
        ans = ans * (pl[i] ** (int(a//n)))
        a = 0
else:
    ans = p

print(ans)
N, M, X, Y =map( int, input()split())
x = list(map( int, input().split()))
y = list(map( int, input().split()))
 
x = sorted(x)
y = sorted(y)
 
for i in range(X + 1, Y + 1):
  if( x[N-1] < i <= y[0]):
    print('No War')
    exit()
    
  else:
    print('War')

### FIXED CODE ###

N, M, X, Y =map( int, input().split())
x = list(map( int, input().split()))
y = list(map( int, input().split()))
 
x = sorted(x)
y = sorted(y)
 
for i in range(X + 1, Y + 1):
  if( x[N-1] < i <= y[0]):
    print('No War')
    exit()
    
print('War')
from math import factorial
S=list(map(int,input()))
S.reverse()
# print(S)
count2019 = [0]*2019
count2019[0]=1

for i in range(len(S)):
    mod2019 =(mod2019+S[i]*10**i)%2019
    count2019[mod2019] +=1

ans =0
for i in count2019:
    if(i>=2):
        ans += factorial(i) // factorial(i) // factorial(i - 2)
print(ans)
# print(count2019)

### FIXED CODE ###

s = list(input())
# s = list(str(10**200000))
n = len(s)
ans = 0
s.reverse()
# print(s)
x = 1
tot = 0
count = [0]*2019
for i in range(n):
    count[tot]+=1
    tot += int(s[i])*x
    # print(tot)
    tot %= 2019
    ans += count[tot]
    x = x*10%2019
print(ans)
import sys
input = sys.stdin.readline
n,m,p=map(int,input().split())
edge = [[] for i in range(m)]
for i in range(m):
  a,b,c=map(int,input().split())
  edge[i]=[a-1,b-1,-c+p]

def sp(s,n,w,es):
  d=[float("inf")]*n
  d[s]=0
  count=0
  ret=[]
  while count<n*2:
    update=False
    for i in range(w):
      e0,e1,e2=es[i]
      if d[e0]!=float("inf") and d[e1]>d[e0]+e2:
        d[e1]=d[e0]+e2
        update=True
    if not update:
      ret.append([d[-1],d[-1]])
      break
    count+=1
    if count%n==0:
      ret.append(d[-1])
  return ret
d1,d2=sp(0,n,m,edge)
print(-1 if d1!=d2 else max(0,-d2))


### FIXED CODE ###

import sys
input = sys.stdin.readline
n,m,p=map(int,input().split())
edge = [[] for i in range(m)]
for i in range(m):
  a,b,c=map(int,input().split())
  edge[i]=[a-1,b-1,-c+p]
d=[float("inf")]*n
d[0]=0

for _ in range(n):
  for i in range(m):
    e0,e1,e2=edge[i]
    d[e1]=min(d[e1],d[e0]+e2)
ans1=d[-1]
for _ in range(n):
  for i in range(m):
    e0,e1,e2=edge[i]
    if d[e1]>d[e0]+e2:
      d[e1]=-float("inf")
ans2=d[-1]
print(-1 if ans1!=ans2 else max(0,-ans1))
import numpy as np
n,k = map(int,input().split())
l = np.zeros((n,k))
for i in range(k):
    d = int(input())
    tmp = list(map(int,input().split()))
    for j in tmp:
        l[j-1][d-1] = 1
print(len(l[np.all(l < 1,axis=1),:]))


### FIXED CODE ###

n,k = map(int,input().split())

judge = [True] * n
for i in range(k):
    j = int(input())
    A = list(map(int,input().split()))
    for a in A:
        judge[a-1] = False

print(judge.count(True))
n = int(input())
s1 = input()
s2 = input()
mod = 10**9+7
b = 0
2did = 0
ans = 0
if s1[0] == s2[0]:
  b = 1
  ans += 3
else:
  2did = 1
  ans = 6
for i in range(1,n):
  if s1[i] == s2[i]:
    if b:
      ans = ans*2%mod
    b = 1
  elif not 2did:
    if b:
      ans = ans*2%mod
    else:
      ans = ans*3%mod
    2did = 1
    b = 0
  else:
    2did = 0
print(ans)

### FIXED CODE ###

n = int(input())
s1 = input()
s2 = input()
mod = 10**9+7
b = 0
did = 0
ans = 0
if s1[0] == s2[0]:
  b = 1
  ans += 3
else:
  did = 1
  ans = 6
for i in range(1,n):
  if s1[i] == s2[i]:
    if b:
      ans = ans*2%mod
    b = 1
  elif not did:
    if b:
      ans = ans*2%mod
    else:
      ans = ans*3%mod
    did = 1
    b = 0
  else:
    did = 0
print(ans)
import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
MOD = 1000000007
def POW(x, y): return pow(x, y, MOD)
def INV(x, m=MOD): return pow(x, m - 2, m)
def DIV(x, y, m=MOD): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()

S = input()
X,Y=LI()

while S and S[0] == 'F':
    S = S[1:]
    X -= 1

isX = True
cur = 0
xs = []
ys = []
for i in range(len(S)):
    if S[i] == 'T':
        if cur:
            if isX:
                xs.append(cur)
            else:
                ys.append(cur)
        isX = not isX
        cur = 0
    elif S[i] == 'F':
        cur += 1

if cur:
    if isX:
        xs.append(cur)
    else:
        ys.append(cur)

X=abs(X)
Y=abs(Y)
sumxs = sum(xs)
sumys = sum(ys)
if X > sumxs or Y > sumys:
    print('No')
    exit()

memo1 = [[0]*(sumxs*2+10) for i in range(len(xs)+1)]
memo2 = [[0]*(sumys*2+10) for i in range(len(ys)+1)]

memo1[0][0] = 1
memo2[0][0] = 1
for i in range(1, len(xs)+1):
    for j in range(-sumxs, sumxs+1):
        memo1[i][j] = memo1[i-1][j+xs[i-1]]
        memo1[i][j] = memo1[i-1][j-xs[i-1]]

# print(len(ys))
# print(len(memo2))
for i in range(1, len(ys)+1):
    for j in range(-sumys, sumys+1):
        memo2[i][j] = memo2[i-1][j+ys[i-1]]
        memo2[i][j] = memo2[i-1][j-ys[i-1]]

print('Yes' if memo1[len(xs)][X] and memo2[len(ys)][Y] else 'No')


### FIXED CODE ###

import math

import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
MOD = 1000000007
def POW(x, y): return pow(x, y, MOD)
def INV(x, m=MOD): return pow(x, m - 2, m)
def DIV(x, y, m=MOD): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()

a,b=LI()

print(math.ceil((a+b)*0.5))
s = input()

ans = 0

q = s.count('?')

rc = [0]
rq = [0]
la = [0]
lq = [0]

for i in range(len(s)-1):
    if s[len(s)-i-1]=='C':
        rc.append(rc[-1]+1)
    else:
        rc.append(rc[-1])
    if s[len(s)-i-1]=='?':
        rq.append(rq[-1] + 1)
    else:
        rq.append(rq[-1])
    if s[i]=='A':
        la.append(la[-1]+1)
    else:
        la.append(la[-1])
    if s[i]=='?':
        lq.append(lq[-1]+1)
    else:
        lq.append(lq[-1])
rc.reverse()
rq.reverse()


for i in range(len(s)):
    if s[i]=='B' or s[i]=='?':
        ans += la[i]*(3**lq[i])*rc[i]*(3**rq[i]) % (10**9+7)
        ans += lq[i]*(3**(lq[i]-1))*rc[i]*(3**rq[i]) % (10**9+7)
        ans += la[i]*(3**lq[i])*rq[i]*(3**(rq[i]-1)) % (10**9+7)
        ans += lq[i]*(3**(lq[i]-1))*rq[i]*(3**(rq[i]-1)) % (10**9+7)

print(int(ans%(10**9+7)))


### FIXED CODE ###

s = input()

ans = 0

rc = [0]
rq = [0]
la = [0]
lq = [0]
q3 = [1]
t = 10**9+7

for i in range(len(s)-1):
    if s[len(s)-i-1]=='C':
        rc.append(rc[-1]+1)
        rq.append(rq[-1])
    elif s[len(s)-i-1]=='?':
        rc.append(rc[-1])
        rq.append(rq[-1]+1)
    else:
        rc.append(rc[-1])
        rq.append(rq[-1])
    if s[i]=='A':
        la.append(la[-1]+1)
        lq.append(lq[-1])
    elif s[i]=='?':
        la.append(la[-1])
        lq.append(lq[-1]+1)
    else:
        la.append(la[-1])
        lq.append(lq[-1])
    q3.append(q3[-1] * 3 % t)
rc.reverse()
rq.reverse()

q3.append(1/3)

for i in range(len(s)):
    if s[i]=='B' or s[i]=='?':
        l = q3[lq[i]-1]
        r = q3[rq[i]-1]
        ans += l*r*(3*la[i]+lq[i])*(3*rc[i]+rq[i]) % t

print(round(ans%t))
def heihou(a,b):
  c=a+b
  c=int(s)
  s=s**1/2
  if s%1==0:
    return "Yes"
  else:
    return "No"
a,b=map(str,input().split())
print(heihou(a,b))

### FIXED CODE ###

def heihou(a,b):
  c=a+b
  s=int(c)
  s=pow(s,1/2)
  if s.is_integer():
    return "Yes"
  else:
    return "No"
a,b=map(str,input().split())
print(heihou(a,b))
s = input()
ans = 0
for s in S:
  if s == "A":
    ans += 1
  elif s == "G":
    ans += 1
  elif s == "T":
    ans += 1
  elif s == "C":
    ans += 1
  else:
    ans = 0
    
print(ans)

### FIXED CODE ###

s = input()
ans = 0
m = 0
for S in s:
  if S in "A":
    ans += 1
  elif S in "G":
    ans += 1
  elif S in "T":
    ans += 1
  elif S in "C":
    ans += 1
  else:
    ans = 0
  m = max(m,ans)
print(m)
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")

### FIXED CODE ###

import sys
r,g,b = map(int,input().split())
k = int(input())
#青＞緑＞赤
count = 0
if g*(2**k)>r:
    while g<=r:
        g*=2
        count += 1
else:
    print("No")
    sys.exit(0)

if b*(2**(k-count))>g:
    print("Yes")
else:
    print("No")
import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
# @lru_cache(maxsize=None)
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])


n, m, k = inpl()
a = inpl()
b = inpl()
tmp = 0
for i in range(len(a)):
    tmp += a[i]
    a[i] = tmp
tmp = 0
for i in range(len(b)):
    tmp += b[i]
    b[i] = tmp
ans = 0
a_start = bisect.bisect_right(a, k)
if a_amount==0:
    print(bisect.bisect_right(b, k))
for a_amount in range(a_start, 0, -1):
    new_k = k - a[a_amount - 1]
    b_amount = bisect.bisect_right(b, new_k)
    ans = max(ans, a_amount + b_amount)
print(ans)


### FIXED CODE ###

import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
# @lru_cache(maxsize=None)
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])


n, m, k = inpl()
a = inpl()
b = inpl()
tmp = 0
for i in range(len(a)):
    tmp += a[i]
    a[i] = tmp
tmp = 0
for i in range(len(b)):
    tmp += b[i]
    b[i] = tmp
ans = 0
a_start = bisect.bisect_right(a, k)
ans = bisect.bisect_right(b, k)
for a_amount in range(a_start, 0, -1):
    new_k = k - a[a_amount - 1]
    b_amount = bisect.bisect_right(b, new_k)
    ans = max(ans, a_amount + b_amount)
print(ans)
N, = map(int, input().split())
X = set(map(int, input().split()))
if len(X) == 3:
    print("Three")
else:
    print("Four")


### FIXED CODE ###

N, = map(int, input().split())
X = set(map(str, input().split()))
if len(X) == 3:
    print("Three")
else:
    print("Four")
n = int(input())

arr = [map(int,raw_input().split()) for i in range(n)]

count = 0
for i in range(n-1):
	for j in range(i+1,n):
			s = sum(arr[i]) + sum(arr[j])
			comb = s*(s-1)/2
			count += comb

print count%(1000000000+7)

### FIXED CODE ###

n = int(input())

arr = map(int,raw_input().split())

arr.sort()

count = 0
for i in range(n):
	count += arr[i*2]

print count
#Palace
N,T,A,*H = map(int,open(0).read().split())
A = [A]*N
for i in range (N):
    H[i] = abs((T-H[i]*0.006)-A[i])
print(H.index(min(H)+1)+1)


### FIXED CODE ###

N = int(input())
T, A = map(int,input().split())
H = list(map(int,input().split()))
 
res = [abs(T-h*0.006-A) for h in H]
print(res.index(min(res))+1)
import itertools

n,m = map(int,input().xplit())
path=[[False]*n for _ in range(n)]
for _ in range(m):
  a,b = map(int,input().split())
  a-=1
  b-=1
  path[a][b]=True
  path[b][a]=True
ans=0

for i in itertools.permutations(range(6), 6):
   if i[0] == 0:
     for j in range(n):
       if j==n-1:
         ans+=1
         break
       if not path[i[j-1]][i[j]]:
         break

print(ans)

### FIXED CODE ###

import itertools

n, m = map(int, input().split())

path = [[False] * n for i in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    path[a][b] = True
    path[b][a] = True

ans = 0

# 頂点を並び替える順列を生成してループ
for i in itertools.permutations(range(n), n):
    # 頂点1が始点
    if i[0] == 0:
        # 生成した順列の中をさらにループ
        for j in range(n):
            # n - 1 まで続いたら条件を満たすパスが存在する
            if j == n - 1:
                ans += 1
                break
            # i[j] から i[j + 1] に行くパスがなければ終了
            if not path[i[j]][i[j + 1]]:
                break

print(ans)
import itertools
import sys

input = sys.stdin.readline

maxn = 10000000000

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

A.append(-maxn)
B.append(-maxn)
C.append(-maxn)

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

apos, bpos, cpos = 0, 0, 0

while (apos + 1) * (bpos + 1) * (cpos + 1) < min(10 ** 7, X * Y * Z):
    if (
        apos < len(A) - 2
        and abs(A[apos] - A[apos + 1]) < abs(B[bpos] - B[bpos + 1])
        and abs(A[apos] - A[apos + 1]) < abs(C[cpos] - C[cpos + 1])
    ):
        apos += 1
    elif bpos < len(B) - 2 and B[bpos] - B[bpos + 1] < C[cpos] - C[cpos + 1]:
        bpos += 1
    else:
        cpos += 1

res = []
for a in list(itertools.product(A[: apos + 1], B[: bpos + 1], C[: cpos + 1])):
    res.append(a[0] + a[1] + a[2])

res.sort(reverse=True)
for k in range(K):
    print(res[k])


### FIXED CODE ###

A = [int(input()) for _ in range(5)]
A.sort()

k = int(input())

if A[-1] - A[0] > k:
    print(":(")
else:
    print("Yay!")