Harryxun/stf_run huggingface dataset:
N, A, B = list(map(int, input().split()))

count = - (-N // (A + B)) -1
amari = N%(A+B)
sum_blue = A * max(count, 1) + min(A, amari)
if N = 0: sum_blue = 0
print(sum_blue)

### FIXED CODE ###

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

count = N // (A + B)
amari = N%(A+B)
sum_blue = A * count + min(A, amari)

print(sum_blue)
n,i=map(int、input().split())
print(n-i+1)


### FIXED CODE ###

n,i=map(int,input().split())
print(n-i+1)
n, k = map(int, input().split())
an = list(map(int, input().split()))

import numpy as np

t= min(k, 45)
bn = np.zeros((t,n), dtype=int)

for k in range(t):
    if k==0:
        for i in range(n):
            for j in range(max(i - an[i], 0), min(n, i + an[i] + 1)):
                bn[k][j] += 1
    else:
        for i in range(n):
            for j in range(max(i - bn[k - 1][i], 0), min(n, i + bn[k - 1][i] + 1)):
                bn[k][j] += 1


print(*bn[t-1])

### FIXED CODE ###

s= str(input())

print(s[:3])
N=int(input())
list=[]
for i in range(N):
  A=int(input())
  list.append(A)
l=sorted(list,reverse=True)
k=set(list)
A_1=k[0]
A_2=k[1]
for j in range(N):
  if list[j]!=A_1:
    print(A_1)
  else:
    print(list[1])


### FIXED CODE ###

N=int(input())
list=[]
for i in range(N):
  A=int(input())
  list.append(A)
l=sorted(list,reverse=True)
A_1=l[0]
A_2=l[1]
for j in range(N):
  if list[j]!=A_1:
    print(A_1)
  else:
    print(A_2)
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A
def A():
    return

#B
def B():
    def comb(a,b):
        return fact[a]*inv_fact[b]*inv_fact[a-b]%mod
    mod = 998244353
    n,a,b,k = LI()
    fact = [1]*(n+1)
    for i in range(1,n+1):
        fact[i] = fact[i-1]*i%mod
    inv_fact = [None]*(n+1)
    inv_fact[n] = pow(fact[n],mod-2,mod)
    for i in range(n)[::-1]:
        inv_fact[i] = inv_fact[i+1]*(i+1)%mod

    ans = 0
    for x in range(n+1):
        if (k-a*x)%b == 0 and k >= a*x:
            y = (k-a*x)//b
            ans += comb(n,x)*comb(n,y)%mod
    print(ans)

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == "__main__":
    B()


### FIXED CODE ###

#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A
def A():
    return

#B
def B():
    def comb(a,b):
        return fact[a]*inv_fact[b]*inv_fact[a-b]%mod
    mod = 998244353
    n,a,b,k = LI()
    fact = [1]*(n+1)
    for i in range(1,n+1):
        fact[i] = fact[i-1]*i%mod
    inv_fact = [None]*(n+1)
    inv_fact[n] = pow(fact[n],mod-2,mod)
    for i in range(n)[::-1]:
        inv_fact[i] = inv_fact[i+1]*(i+1)%mod

    ans = 0
    for x in range(n+1):
        if (k-a*x)%b == 0 and k >= a*x and k-a*x <= n*b:
            y = (k-a*x)//b
            ans += comb(n,x)*comb(n,y)%mod
        ans %= mod
    print(ans)

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == "__main__":
    B()
L = ['A','C','G','T']
S = list(input()) 
S = ['1' if ((i in L) == True) else '0' for i in S]
S = ''.join(S_list)
S = S.split('0')
S = [len(i) for i in S]
print(max(S))

### FIXED CODE ###

S_list = list(input()) 
S_list = ['1' if i == 'A' or i == 'C' or  i == 'G' or i == 'T' else '0' for i in S_list]
S = ''.join(S_list)
S = S.split('0')
X = 0
for i in range(len(S)):
    if len(S[i]) > X:
        X = len(S[i])
print(X)
import numpy as np

N, K = map(int, input().split())
A = list(map(int, input().split()))
M = 10**9 + 7

def prod(X):
    ans = 1
    for x in X:
        ans = ans * x % M
    return ans

def solve():
    # Case 1: N == K
    if N == K:
        return prod(A)

    # Case 2: ans is negative
    if all(a < 0 for a in A) and K % 2 == 1:
        return prod(sorted(A)[-K:])

    # Case 3: ans is positive
    posA = np.int64(sorted([a for a in A if a >= 0]))
    negA = np.int64(sorted([a for a in A if a < 0]))

    ans = 1
    if K % 2 == 1: # keep the largest positive
        ans = ans * posA[-1] % M
        posA = posA[:-1]
    
    pos_pairs = posA[0::2] * posA[1::2]
    neg_pairs = negA[0::2] * negA[1::2]
    pairs = np.concatenate([pos_pairs, neg_pairs], axis=0)
    pairs = np.sort(pairs)[-(K//2):].tolist()
    ans = ans * prod(pairs) % M
    return ans

print(solve())
        


### FIXED CODE ###

import numpy as np

N, K = map(int, input().split())
A = list(map(int, input().split()))
M = 10**9 + 7

def prod(X):
    ans = 1
    for x in X:
        ans = ans * x % M
    return ans

def solve():
    # Case 1: N == K
    if N == K:
        return prod(A)

    # Case 2: ans is negative
    if all(a < 0 for a in A) and K % 2 == 1:
        return prod(sorted(A)[-K:])

    # Case 3: ans is positive
    posA = np.int64(sorted([a for a in A if a >= 0]))
    negA = np.int64(sorted([a for a in A if a < 0]))

    ans = 1
    if K % 2 == 1: # Keep the largest positive
        ans = ans * posA[-1] % M
        posA = posA[:-1]
    
    # Construct largest value by pairing items
    if len(posA) % 2 == 1: # Discard the one with smallest absolute value
        posA = posA[1:]
    if len(negA) % 2 == 1: # Discard the one with smallest absolute value
        negA = negA[:-1]
    pos_pairs = posA[0::2] * posA[1::2]
    neg_pairs = negA[0::2] * negA[1::2]
    pairs = np.concatenate([pos_pairs, neg_pairs], axis=0).tolist()
    pairs = sorted(pairs, reverse=True)[:K//2]
    ans = ans * prod(pairs) % M

    return ans

print(solve())
SUN = 7
MON = 1
TUE = 2
WED = 3
THU = 4
FRI = 5
SAT = 6

A =  input()


print(7 - A)

### FIXED CODE ###

#変b数のまとめの入力についてsplitとインデックスで価を特定させる

youbi = "SUN,MON,TUE,WED,THU,FRI,SAT".split(",")
a = input()
print(7 - youbi.index(a))
tree = {}
    N, Q = map(int, input().split(' '))
    for i in [input() for i in range(N-1)]:
        A, B = map(int, i.split(' '))

        if A not in tree:
            tree[A] = []

        if B not in tree:
            tree[B] = [A]
        else:
            tree[B].append(A)

    point = [0] * (N + 1)
    for i in [input() for i in range(Q)]:
        A, B = map(int, i.split(' '))
        point[A] += B
        
    pointList = [0] * (N + 1)
    for idx, val in enumerate(tree):
        for v in tree[val]:
            pointList[val] += pointList[v]
        pointList[val] += point[val]
            
    print(*pointList[1:])


### FIXED CODE ###

from collections import deque
 
if __name__ == "__main__":
    N, q = map(int, input().split())
    links = [[] for _ in range(N)]
    
    for i in range(N - 1):
        a, b = map(int, input().split())
        links[a - 1].append(b - 1)
        links[b - 1].append(a - 1)
    
    ans = [0] * N
    for i in range(q):
        p, x = map(int, input().split())
        ans[p - 1] += x

    deq = deque([0])
    visited = [False] * N
    while deq:
        parent = deq.popleft()
        link = links[parent]
        for v in link:
            if not visited[v]:
                ans[v] += ans[parent]
                deq.append(v)
        visited[parent] = True
    
    print(*ans)
a,b=int(input())
if a==3,b==1 :
  print(2)
elif a==1,b==2 :
  print(3)
elif a==2,b==3 :
  print(1)

### FIXED CODE ###

a=int(input())
b=int(input())
if a==3 and b==1 :
  print(2)
elif a==1 and b==2 :
  print(3)
elif a==2 and b==3 :
  print(1)
elif a==3 and b==2 :
  print(1)
elif a==1 and b==3 :
  print(2)
elif a==2 and b==1 :
  print(3)
'''input
100000 5
'''
from math import ceil, log2
N, K = [int(x) for x in input().split()]

ats = 0.0

for i in range(1, N+1):
	if i >= K:
		ats += 1/N
		continue

	ats += 1/N*2**(-ceil(log2(K/i)))

print(ats)

### FIXED CODE ###

'''input
100000 5
'''
from math import ceil, log2
N, K = [int(x) for x in input().split()]

ats = 0.0

for i in range(1, N+1):
	if i >= K:
		ats += 1/N
		continue

	ats += 1/N/(2.0**(float(ceil(log2(K/i)))))

print(ats)
A,B,C,X=[int(input()) for i in range(4)]
print(sum(500*a+100*b+50*c==X for a in range(A+1) for b in range(B+1) for c in range (c+1)))

### FIXED CODE ###

A,B,C,X=[int(input()) for i in range(4)]
print(sum(500*a+100*b+50*c==X for a in range(A+1) for b in range(B+1) for c in range (C+1)))
CA = [list(map(int, input().split())) for i in range(N)]

A = [0]*M
for i in range(N):
    for k in range(M):
        A[k] += CA[i][k+1]
for i in range(M):
    if A[i] < X:
        print('-1')
        exit() 

price = 0
ans = 10**10
A = [0]*M
for i in range(2**N):
    list = [1]*N
    for j in range(len(list)):
        if (i>>j) & 1:
            list[j] = 0
        for k in range(N):
            if list[k] == 1:
                for s in range(M):
                    A[s] += CA[k][s+1]
                price += CA[k][0]
        if all(A[m] >= X for m in range(M)):
            ans = min(ans,price)
    price = 0
print(ans)

### FIXED CODE ###

N, M, X = map(int, input().split())
CA = [list(map(int, input().split())) for i in range(N)]

A = [0]*M
for i in range(N):
    for k in range(M):
        A[k] += CA[i][k+1]
for i in range(M):
    if A[i] < X:
        print('-1')
        exit() 

price = 0
ans = 10**10
A = [0]*M
for i in range(2**N):
    list = [1]*N
    for j in range(len(list)):
        if (i>>j) & 1:
            list[j] = 0
        price = 0
        A = [0]*M
        for k in range(N):
            if list[k] == 1:
                for s in range(M):
                    A[s] += CA[k][s+1]
                price += CA[k][0]
    if all(A[m] >= X for m in range(M)):
        ans = min(ans,price)
print(ans)
nums = list(map(int,input(),split())
nums.sort()
if nums[0] == 5 and nums[1] == 5 and nums[2] == 7:
	print("YES")
else:
	print("NO")

### FIXED CODE ###

nums = list(map(int,input().split()))
nums.sort()
if nums[0] == 5 and nums[1] == 5 and nums[2] == 7:
            print("YES")
else:
            print("NO")
n = int(input())
alist = list(map(int,input()))
from collections import Counter
adic = Counter(alist)
count = 0
for key,value in adic:
  if int(key) =< value:
    count+=(value-int(key))
  else:
    count+=value
print(count)

### FIXED CODE ###

n = int(input())
alist = list(map(int,input().split()))
from collections import Counter
adic = Counter(alist)
count = 0
for k,v in adic.items():
  if int(k) <= v:
    count+=(v-int(k))
  else:
    count+=v
print(count)
N = int(input())
ret = 10000
for A in range(1, N):
    ret = min(ret, digit_sum(A) + digit_sum(N-A))
print(ret)

### FIXED CODE ###

def digit_sum(i):
    return sum([int(digit) for digit in list(str(i))])

N = int(input())
ret = 10000
for A in range(1, N):
    ret = min(ret, digit_sum(A) + digit_sum(N-A))
print(ret)
N,C = map(int,input().split())
tv_times = [[int(j) for j in input().split()] for i in range(N)]

channells = {}
for i in range(C+1):
    channells[i] = []
max_end = -1

for i in range(N):
    s,g,c = tv_times[i]
    max_end = max(max_end,g)
    channells[c] += [s,g]

tv_times = []
f = [0 for i in range(max_end+1)]
for cha in channells.keys():
    remove_list = []
    time = channells[cha]
    for i in range(1,len(time)-1):
        if time[i] == time[i+1]:
            remove_list.append(time[2*i+1])
    time = list(set(time)-set(remove_list))
    time.sort()
    # print(time)
    # print(time)
    # print(f)
    for i in range(len(time)//2):
        f[max(time[2*i]-1,0)] += 1
        f[time[2*i+1]] -= 1

ans = -1
for i in range(1,max_end+1):
    f[i] += f[i-1]
    if ans < f[i]:
        ans = f[i]

# print(f)
print(ans)


### FIXED CODE ###

N,C = map(int,input().split())
tv_times = [[int(j) for j in input().split()] for i in range(N)]

channells = {}
for i in range(C+1):
    channells[i] = []
max_end = -1

for i in range(N):
    s,g,c = tv_times[i]
    max_end = max(max_end,g)
    channells[c] += [s,g]

tv_times = []
f = [0 for i in range(max_end+1)]
for cha in channells.keys():
    remove_list = []
    time = channells[cha]
    time.sort()
    for i in range(1,len(time)-1):
        if time[i] == time[i+1]:
            remove_list.append(time[i])
    time = list(set(time)-set(remove_list))
    time.sort()
    for i in range(len(time)//2):
        f[max(time[2*i]-1,0)] += 1
        f[time[2*i+1]] -= 1
ans = -1
for i in range(1,max_end+1):
    f[i] += f[i-1]
    if ans < f[i]:
        ans = f[i]

print(ans)
n = int(input())
A = sorted(list(map(int, input().split())))
if len(set(A)) == 1:
    print(0)
    exit()

from collections import Counter
c = Counter(A)

count = 0
NMAX = 2 * 10 ** 3 + 10
L = [True] * (NMAX + 1)
for k, v in c.items():
    p = k
    if L[p]:
        for i in range(p * 2, NMAX + 1, p):
            L[i] = False

for k, v in c.items():
    if v > 1: continue
    if L[k] == True:
        count += 1

print(count)

### FIXED CODE ###

n = int(input())
A = sorted(list(map(int, input().split())))

from collections import Counter
c = Counter(A)

NMAX = 10 ** 6 + 1000
dp = [True] * (NMAX + 1)

for x in A:
    if not dp[x]:
        continue
    for i in range(x * 2, NMAX + 1, x):
        dp[i] = False
    if c[x] > 1:
        dp[x] = False
    
count = 0
for x in A:
    if dp[x]:
        count += 1

print(count)
from collections import Counter
from pandas import Series
 
N,K=map(int,input().split())
A=list(map(int,input().split()))
count=0
S=set(A)
c=Counter(A)
L=c.most_common(len(S))
 
x=len(S)-1
for _ in range(len(S)-K):
    count=count+int(L[x][1])
    x=x-1
 
print(count)

### FIXED CODE ###

from collections import Counter


N,K=map(int,input().split())
A=list(map(int,input().split()))
count=0
S=set(A)
c=Counter(A)
L=c.most_common(len(S))

x=len(S)-1
for _ in range(len(S)-K):
    count=count+int(L[x][1])
    x=x-1

print(count)
import bisect
import numpy

n, m, k = map(int, input().split(" "))
a = list(map(int, input().split(" ")))
b = list(map(int, input().split(" ")))

cost_a = numpy.insert(numpy.cumsum(a), 0, 0)
cost_b = numpy.insert(numpy.cumsum(b), 0, 0)

left_max = bisect.bisect_left(cost_a, k)
right_max = bisect.bisect_left(cost_b, k)

ans = 0
j = right_max
for i in range(left_max):
    for j in range(j , -1, -1):
        if cost_a[i] + cost_b[j] <= k:
            ans  = i + j if ans < i + j else ans
            break
print(ans)

### FIXED CODE ###


import bisect
import numpy

n, m, k = map(int, input().split(" "))
a = list(map(int, input().split(" ")))
b = list(map(int, input().split(" ")))

cost_a = numpy.insert(numpy.cumsum(a), 0, 0)
cost_b = numpy.insert(numpy.cumsum(b), 0, 0)

ans = 0
j =  len(cost_b) -1
for i in range(len(cost_a)):
    for j in range(j, -1, -1):
        if cost_a[i] + cost_b[j] <= k:
            ans  = i + j if ans < i + j else ans
            break
print(ans)
N = int(input())
A = [0]
A.extend(list(map(int, input().split())))

buka_num = [0]

for i in range(1, N):
  tmp_A = A[i:]
	buka_num.append(tmp_A.count(i))

buka_num.append(0)

print(buka_num, sep='¥n')

### FIXED CODE ###

import collections
N = int(input())
A = [0]
A.extend(list(map(int, input().split())))
c = collections.Counter(A)
buka_num = []

for i in range(1,N):
    buka_num.append(c[i])
    
buka_num.append(0)
for ele in buka_num:
    print(ele)
n,m=map(int,input().split())
inf=float("inf")

r=lambda n:range(n)
l=[[inf if i!=j else 0 for j in r(n)] for i in r(n)]
a,b,c=[None]*n,[None]*n,[None]*n

for i in r(m):
  a[i],b[i],c[i]=map(int,input().split())
  a[i]-=1
  b[i]-=1
  l[a[i]][b[i]]=c[i]
  l[b[i]][a[i]]=c[i]

for k in r(n):
  for i in r(n):
    for j in r(n):
      l[i][j]=min(l[i][j],l[i][k]+l[k][j])

ans=m
for i in r(m):
  f=False
  for j in r(n):
    if l[j][a[i]]+c[i]==l[j][b[i]]:
      f=True
  if f:ans-=1
print(ans)

### FIXED CODE ###

n,m=map(int,input().split())
inf=float("inf")

r=lambda n:range(n)
l=[[inf if i!=j else 0 for j in r(n)] for i in r(n)]
a,b,c=[None]*m,[None]*m,[None]*m

for i in r(m):
  a[i],b[i],c[i]=map(int,input().split())
  a[i]-=1
  b[i]-=1
  l[a[i]][b[i]]=c[i]
  l[b[i]][a[i]]=c[i]

for k in r(n):
  for i in r(n):
    for j in r(n):
      l[i][j]=min(l[i][j],l[i][k]+l[k][j])

ans=m
for i in r(m):
  f=False
  for j in r(n):
    if l[j][a[i]]+c[i]==l[j][b[i]]:
      f=True
  if f:ans-=1
print(ans)
=int(input())
A=list(map(int,input().split()))
x=0
y=0
z=0
ans=1
for a in A:
    c=0
    X,Y,Z=x,y,z
    if a==x:
        x+=1
        c+=1
    if a==y:
        c+=1
        if a!=X:
            y+=1
    if a==z:
        c+=1
        if a!=X and a!=Y:
            z+=1
    ans=ans*c%1000000007
print(ans)

### FIXED CODE ###

n=int(input())
A=list(map(int,input().split()))
x=0
y=0
z=0
ans=1
for a in A:
    c=0
    X,Y,Z=x,y,z
    if a==x:
        x+=1
        c+=1
    if a==y:
        c+=1
        if a!=X:
            y+=1
    if a==z:
        c+=1
        if a!=X and a!=Y:
            z+=1
    ans=ans*c%1000000007
print(ans)
import numpy as np


S = input().strip()

MOD = 10 ** 9 + 7

N = len(S)
DP = np.zeros((N+1, 13))
DP[0, 0] = 1

for _i, s in enumerate(S):
    i = _i + 1

    if s == '?':
        candidate = range(10)
    else:
        candidate = [int(s)]

    for j in range(13):
        for c in candidate:
            m = (j * 10 + c) % 13
            DP[i, m] += DP[i-1, j]
    DP[i] %= MOD

print(int(DP[-1, 5]))

### FIXED CODE ###

S = input().strip()

MOD = 10 ** 9 + 7

N = len(S)
DP = [[0] * 13 for i in range(N+1)]
DP[0][0] = 1

for _i, s in enumerate(S):
    i = _i + 1

    if s == '?':
        candidate = range(10)
    else:
        candidate = [int(s)]

    for j in range(13):
        for c in candidate:
            m = (j * 10 + c) % 13
            DP[i][m] += DP[i-1][j]
    for j in range(13):
        DP[i][j] %= MOD

print(int(DP[-1][5]))
import sys
sys.setrecursionlimit(10000)


def input():
    return sys.stdin.readline().rstrip()


def dfs(a, m):
    if max(a) == 0:
        return 0
    if m == 0:
        return sum(a)
    a[a.index(max(a))] //= 2
    return dfs(a, m-1)


def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))

    print(dfs(A, M))


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import heapq


def input():
    return sys.stdin.readline().rstrip()


def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    for i in range(N):
        A[i] *= -1
    heapq.heapify(A)

    for i in range(M):
        maxa = -1 * heapq.heappop(A)
        if maxa == 0:
            print("0")
            exit()
        heapq.heappush(A,  maxa // 2 * (-1))
    print(sum(A) * (-1))


if __name__ == '__main__':
    main()
N,Ma,Mb=map(int,input().split())
a=[0 for k in range(N)]
b=[0 for k in range(N)]
c=[0 for k in range(N)]

for k in range(N):
    a[k],b[k],c[k]=map(int,input().split())
Sa=sum(a)
Sb=sum(b)
dp =[[5000 for k in range(Sb+1)]for k in range(Sa+1)]
dp[0][0]=0
for k in range(N):
    for j in range(Sa-a[k]+1):
        for l in range(Sb-b[k]+1):
            dp[j+a[k]][l+b[k]]=min(dp[j][l]+c[k], dp[j+a[k]][l+b[k]])

ans=[5000]
for k in range(1, max(sum(a)//Mb,sum(b)//Ma)+1):
    ans.append(dp[Mb*k][Ma*k])
if min(ans)==5000:
    print(-1)
else:
    print(min(ans))

### FIXED CODE ###

N,Ma,Mb=map(int,input().split())
a=[0 for k in range(N)]
b=[0 for k in range(N)]
c=[0 for k in range(N)]
import copy
for k in range(N):
    a[k],b[k],c[k]=map(int,input().split())
Sa=sum(a)
Sb=sum(b)
dp =[[[5000 for k in range(Sb+1)]for k in range(Sa+1)]for k in range(N+1)]
dp[0][0][0]=0
for k in range(N):
    listj=[]
    listl=[]
    for j in range(Sa-a[k]+1):
        for l in range(Sb-b[k]+1):
            if dp[k][j][l]!=5000:
                listj.append(j)
                listl.append(l)
    for m in range(len(listl)):
        dp[k+1][listj[m]+a[k]][listl[m]+b[k]]=min(dp[k][listj[m]][listl[m]]+c[k], dp[k][listj[m]+a[k]][listl[m]+b[k]])
        dp[k+1][listj[m]][listl[m]]=min(dp[k][listj[m]][listl[m]], dp[k+1][listj[m]][listl[m]])
ans=[5000]
for k in range(1, min(Sa//Ma,Sb//Mb)+1):
    ans.append(dp[-1][Ma*k][Mb*k])
if min(ans)==5000:
    print(-1)
else:
    print(min(ans))
import fractions
a = list(map(int, input().split()))
ans = a[0]
for i in a:
    ans = fractions.gcd(ans, i)

A = a[0]//ans
B = a[1]//ans
C = a[2]//ans

def bisearch(f, n):
    l = 0
    r = n
    fl = f(l)
    fr = f(r)
    while l <= r:
        m = (l + r) // 2
        fm = f(m)
        #print l,m,r,fl,fm,fr,n
        if fm == n:
            return m
        elif fm > n:
            r = m - 1
            fr = f(r)
        else:
            l = m + 1
            fl = f(l)

def try_square_root(n2):
    return bisearch(lambda n:n*n, n2)

if try_square_root(A) + try_square_root(B) == try_square_root(C):
  print("No")
elif sqrt(A) +sqrt(B) < sqrt(C):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

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

if c-a-b>0 and 4*a*b<(c-a-b)**2:
  print("Yes")
else:
  print("No")
import numpy as np
N, M = map(int, input().split())
X = list(map(int, input().split()))

if M <= N:
    print(0)
else:
    X.sort()
    # print("X =", X)
    dX = np.diff(X)
    # print("dX =", dX)
    dX.sort()
    print(sum(dX[:M-N]))

f.close()

### FIXED CODE ###

import numpy as np
N, M = map(int, input().split())
X = list(map(int, input().split()))

if M <= N:
    print(0)
else:
    X.sort()
    # print("X =", X)
    dX = np.diff(X)
    # print("dX =", dX)
    dX.sort()
    print(sum(dX[:M-N]))
h1, m1, h2, m2, k = map(int, input().split())
 
f = h1 * 60 + m1
t = h2 * 60 + m2
 
if time < 0:
  print(0)
else:
  print(time)

### FIXED CODE ###

h1, m1, h2, m2, k = map(int, input().split())

f = h1 * 60 + m1
t = h2 * 60 + m2

time = t - f - k
if time < 0:
  print(0)
else:
  print(time)
h1=input()
h = h1**3
print(h)

### FIXED CODE ###

x = int(input())
print(x*x*x)
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
ls = []
for i in range(4):
    ls.append(int(input()))
ansls=[]
k = input()
for i in range(4):
    m = ls[i+1]-ls[0]
    ansls.append(m)

if max(ansls)>k:
    print(':(')
else:
    print('Yay!')

### FIXED CODE ###

#! /usr/bin/env python3
# -*- coding: utf-8 -*-
ls = []
for i in range(5):
    ls.append(int(input()))
k = int(input())
if ls[4]-ls[0] <= k:
    print('Yay!')
else:
    print(':(')
n = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
count = 0
for i in a:
	if(i * 4 * n[1] >= n[0]):
		count += 1
if(count >= n[1]):
	print('Yes')
else:
	print('No')

### FIXED CODE ###

a = [int(i) for i in input().split()]
print(a[2],a[0],a[1],sep=' ')
import math
def lcm(a, b):
    return a * b / math.gcd(a, b)

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

A_half = [0.5 * a for a in A]
A_lcm = A_half[0]

for i in range(1, N):
    A_lcm = lcm(int(A_lcm), int(A_half[i]))

ans = (M // A_lcm) // 2 if (M // 2) % 2 == 0 else (M // A_lcm) // 2 + 1
print(int(ans))

### FIXED CODE ###

from fractions import gcd

N, M = map(int, input().split())
A = [int(i) // 2 for i in input().split()]  

A_lcm = 1
for i in range(N):
    A_lcm *= A[i] // gcd(A_lcm, A[i])
    
for i in A:
    if A_lcm // i % 2 == 0:
        print(0)
        exit()

print((M // A_lcm + 1) // 2)