Harryxun/stf_run huggingface dataset:
A,B,C,D,E,F=map(int,input().split())
#100*A*i + 200*B*j == x
#C*i + D*j == y
xs = []
ys = []
def dens(x,y):
    if x+y==0:
        return(-1)
    else:
        return(y/(x+y))
for i in range(31):
    for j in range(16):
        if 100*A*i + 200*B*j <= F:
            xs.append(100*A*i + 200*B*j)
for i in range(3001):
    for j in range(1501):
        if C*i + D*j <= F:
            ys.append(C*i + D*j)
density = 0
for x in xs:
    for y in ys:
        if x+y > F or 100*y > E*x:
            continue
        nd = dens(x,y)
        if nd > density:
            density = nd
            sugar = y
            water = x
            #print([sugar,water,density])
print(str(water+sugar) + " " + str(sugar))


### FIXED CODE ###

A,B,C,D,E,F=map(int,input().split())
#100*A*i + 200*B*j == x
#C*i + D*j == y
xs = []
ys = []
def dens(x,y):
    if x+y==0:
        return(-1)
    else:
        return(y/(x+y))
for i in range(31):
    for j in range(16):
        if 100*A*i + 200*B*j <= F:
            xs.append(100*A*i + 200*B*j)
for i in range(3001):
    for j in range(1501):
        if C*i + D*j <= F:
            ys.append(C*i + D*j)
density = 0
water = 100*A
sugar = 0
for x in xs:
    for y in ys:
        if x+y > F or 100*y > E*x:
            continue
        nd = dens(x,y)
        if nd > density:
            density = nd
            sugar = y
            water = x
print(str(water+sugar) + " " + str(sugar))
d = int(input())

if d == 25:
    pritn("Christmas")
elif d == 24:
    print("hristmas Eve")
elif d == 23:
    print("Christmas Eve Eve")
else:
    print("Christmas Eve Eve Eve")


### FIXED CODE ###

d = int(input())
 
if d == 25:
    print("Christmas")
elif d == 24:
    print("Christmas Eve")
elif d == 23:
    print("Christmas Eve Eve")
else:
    print("Christmas Eve Eve Eve")
# -*- coding: utf-8 -*-
from collections import deque
n, k = map(int, input().split())
s = input()

unhapiness = 0
div = deque([])
conv = deque([])
left = "R"
right = "L"
cntr = 0
s = s + "L"
for si in s:
    right = si
    if (left == "R") & (right == "L"):
        if 0 < cntr < n:
            unhapiness += 2
            div.append(cntr)
        else:
            unhapiness += 1
            div.appendleft(cntr)
    if (left == "L") & (right == "R"):
        conv.appendleft(cntr)

    left = si
    cntr +=1

for i in range(k):
    p = div.pop()
    conv.pop()
    if 0 < p < n:
        unhapiness -= 2
    else:
        unhapiness -= 1

print(n-unhapiness)


### FIXED CODE ###

# -*- coding: utf-8 -*-
from collections import deque
n, k = map(int, input().split())
s = input()

unhapiness = 0
div = deque([])
left = "R"
right = "L"
cntr = 0
s = s + "L"
for si in s:
    right = si
    if (left == "R") & (right == "L"):
        if 0 < cntr < n:
            unhapiness += 2
            div.append(cntr)
        else:
            unhapiness += 1
            div.appendleft(cntr)

    left = si
    cntr +=1

for i in range(k):
    p = div.pop()
    if 0 < p < n:
        unhapiness -= 2
    else:
        unhapiness -= 1
    if len(div) < 1:
        unhapiness += 1
        break
print(n-unhapiness)
a=input()
if len(a)%2==0:
    v=len(a)/2
else:
    v=(len(a)-1)/2
c=0
for i in range(v):
    if a[i]!=a[-i-1]:
        c+=1
print(c)

### FIXED CODE ###

a=input()
if len(a)%2==0:
    v=int(len(a)/2)
else:
    v=int((len(a)-1)/2)
c=0
for i in range(v):
    if a[i]!=a[-i-1]:
        c+=1
print(c)
N = int(input())
L = list(map(int , input().split( )))

L_max = max(L)
L_sum = sum(L)

if L_max < L_sum - L_max:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

s = list(map(float ,input().split( )))
print(s[0]/s[1])
n = int(input())
prime5 = []
for i in range(1,5600):
  a = i * 10 + 1
  # flag = True
  for j in range(3,int(a**0.5) + 1):
    if a % j == 0:
      # flag = False
  else: prime5.append(a)
print(*prime5[:n])

### FIXED CODE ###

n = int(input())
prime5 = []
for i in range(1,5600):
  a = i * 10 + 1
  flag = True
  for j in range(3,int(a**0.5) + 1):
    if a % j == 0:
      flag = False
  if flag: prime5.append(a)
print(*prime5[:n])
a = int(input())
printf(a * 2 * 3.1415926535)

### FIXED CODE ###

a = int(input())
print(a * 2 * 3.1415926535)
n, y = (int(i) for i in input().split())  
a=-1
b=-1
c=-1
for i in range(n+1):
  for j in range(n-i+1):
      if 10000*i+5000*j+1000*(n-i-j+1)==y:
        a=i
        b=j
        c=n-i+j+1
        break

print(a b c)        

### FIXED CODE ###

n, y = (int(i) for i in input().split())  
a=-1
b=-1
c=-1
for i in range(n+1):
  for j in range(n-i+1):
      if 10000*i+5000*j+1000*(n-i-j)==y:
        a=i
        b=j
        c=n-i-j
        break

print(a ,b ,c)
i = 1
while true:
 a = raw_input()
 if a = '0':
  break
 print "Case %d: %s" % (i,a)

### FIXED CODE ###

i = 1
while True:
 a = raw_input()
 if a == '0':
  break
 print "Case %s: %s" % (i,a)
 i += 1
from collections import Counter
def solve():
    n = int(input())
    a = list(map(int, input().split()))

    l = Counter(a)
    tw = []
    fo = []
    for i,j in l.items():
        if j >= 2:
            tw.append(i)
        if j >= 4:
            fo.append(i)

    if len(tw) >= 2 or fo:
        tw.sort()
        return max(tw[-1]*tw[-2], fo[-1]**2)
    else:
        return 0
    

print(solve())


### FIXED CODE ###

from collections import Counter
def solve():
    n = int(input())
    a = list(map(int, input().split()))

    l = Counter(a)
    tw = []
    fo = []
    for i,j in l.items():
        if j >= 2:
            tw.append(i)
        if j >= 4:
            fo.append(i)
    ans = 0
    if len(tw) >= 2:
        tw.sort()
        ans = max(ans, tw[-1]*tw[-2])
    if fo:
        fo.sort()
        ans = max(ans, fo[-1]**2)
    
    return ans
    

print(solve())
import math
def main():
    r = int(input())
    s = math.pi * r ** 2
    l = r * 2 * math.pi
    print(format(s, ".6f"), format(l, ".6f"))


if __name__ == "__main__":
    main()

### FIXED CODE ###

import math
def main():
    r = float(input())
    s = math.pi * r ** 2
    l = r * 2 * math.pi
    print(format(s, ".6f"), format(l, ".6f"))


if __name__ == "__main__":
    main()
strlist1 = input()
strlist2 = input()
print(strlist1)
print(strlist2)

flag = true

for i in range(3):
  if strlist1[i] != strlist2[2 - i]:
    flag = false

if flag:
  print("YES")
else:
  print("NO")


### FIXED CODE ###

strlist1 = input()
strlist2 = input()

flag = True

for i in range(3):
  if strlist1[i] != strlist2[2 - i]:
    flag = False

if flag:
  print("YES")
else:
  print("NO")
a=int(input())
b=int(input())

### FIXED CODE ###

a,b = input().split()

if (int(a)*int(b))%2==0:
    print("Even")
else:
    print("Odd")
from collections import deque

N, M, K = [int(x) for x in input().split()]

a_book = [0]
for index, i in enumerate(input().split(), 1):
    a_book.append(a_book[index-1] + int(i))

b_book = [0]
for index, i in enumerate(input().split(), 1):
    b_book.append(b_book[index-1] + int(i))

search = deque()
check = {}


def search_count(v):
    search.appendleft(v)
    while search:
        v = search.popleft()

        if not v in check:
            check[v] = v[0] + v[1]

            if not (v[0] + 1, v[1]) in check:
                if v[0] + 1 <= N:
                    if a_book[v[0] + 1] + b_book[v[1]] <= K:
                        search.appendleft((v[0] + 1, v[1]))

            if not (v[0], v[1] + 1) in check:
                if v[1] + 1 <= M:
                    if a_book[v[0]] + b_book[v[1] + 1] <= K:
                        search.appendleft((v[0], v[1] + 1))


search_count((0, 0))

print(max(check.values()))


### FIXED CODE ###

a = int(input())

print(a + a**2 + a**3)
N = int(input())
B = list(map(int, input().split()))

one =[]
two =[]
count = 0
if N%2 ==0:
  while count <= N:
    one.append(max(B))
    B.remove(max(B))
    two.append(max(B))
    B.remove(max(B))
    count +=2
else:
  while count <= N-2:
    one.append(max(B))
    B.remove(max(B))
    two.append(max(B))
    B.remove(max(B))
    count +=2
  one.append(max(B))
  B.remove(max(B))

print(sum(one)-sum(two))

### FIXED CODE ###

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

one =[]
two =[]
count = 0
if N%2 ==0:
  while count <= N-1:
    one.append(max(B))
    B.remove(max(B))
    two.append(max(B))
    B.remove(max(B))
    count +=2
else:
  while count <= N-2:
    one.append(max(B))
    B.remove(max(B))
    two.append(max(B))
    B.remove(max(B))
    count +=2
  one.append(max(B))
  B.remove(max(B))

print(sum(one)-sum(two))
s = map(int,input())
a = map(str,input())
if s >= 3200:
print("red")
else:
print(a)

### FIXED CODE ###

a = int(input())
s = str(input())
if a >= 3200:
 print(s)
if a < 3200:
 print("red")
s,w = map(int,input().split(' '))
if w >= s:
  print(unsafe)
else:
  print(safe)

### FIXED CODE ###

s,w = map(int,input().split(' '))
if w >= s:
  print('unsafe')
else:
  print('safe')
N, X, T = list(map(int(input().split())))

print((N // X + 1) * T)

### FIXED CODE ###

import math

N, X, T = list(map(int, input().split()))

print(math.ceil(N / X) * T)
# -*- coding: utf-8 -*-

import sys

outList = []
for line in sys.stdin.readlines():
    List = map(int, line.strip().split())

    [a, b] = List

    # LCM
    LCM = 1
    for i in xrange(2, max(a, b)):
        if isprime(a) or isprime(b): break
        while(a % i == 0 and b % i == 0):
            LCM *= i
            a /= i
            b /= i

    # GCD
    GCD = List[0] * b

    print LCM, GCD

def isprime(n):
    for i in xrange(2, int(n ** 0.5) ):
        if n % i == 0: return False
    return True

### FIXED CODE ###

# -*- coding: utf-8 -*-

import sys

def isprime(n):
    for i in xrange(2, int(n ** 0.5)+1 ):
        if n % i == 0: return False
    return True


outList = []
for line in sys.stdin.readlines():
    List = map(int, line.strip().split())

    [a, b] = List

    # LCM
    LCM = 1
    i = 1
    while( i <= min(a, b) ):
        i += 1
        if not isprime(i): continue
        while(a % i == 0 and b % i == 0):
            LCM *= i
            a /= i
            b /= i

    # GCD
    GCD = List[0] * b

    print LCM, GCD
from collections import deque
n=int(input())
A=deque(sorted([int(input()) for i in range(n)]))
B=deque([A.popleft()])

flag,ans=1,0
while len(A)!=0:
    if flag==1:L,R=A.pop(),A.pop()
    else:L,R=A.popleft(),A.popleft()

    if abs(L-B[0])>abs(R-B[-1]):
        ans +=abs(L-B[0])+abs(R-B[-1])
        B.append(R)
        B.appendleft(L)
    else:
        ans +=abs(R-B[0])+abs(L-B[-1])
        B.append(L)
        B.appendleft(R)

    if len(A)==1:
        ans +=max(abs(B[0]-A[0]),abs(B[-1]-A[0]))
        break

    flag=flag*-1

print(ans)

### FIXED CODE ###

n=int(input())
a=[int(input())for _ in range(n)]
if n==2:print(abs(a[0]-a[1]));exit()
f=[-1]
for i in range(1,n-1-(n%2==0)):
  if i%2:f.append(2)
  else:f.append(-2)
if n%2:f+=[-1]
else:f+=[-2,1]
b=[]
c=[]
for i in f:
  b.append(i)
  c.append(-i)
b.sort()
c.sort()
sb=sc=0
a.sort()
for i in range(n):
  sb+=a[i]*b[i]
  sc+=a[i]*c[i]
print(max(sb,sc))
n = int(input())
a = list(map(int, input().split(" ")))
for i in range(1, n-1):
    print(a)
    if 0 <= a[i-1] and 0 <= a[i] and 0 <= a[i+1]:
        continue
    elif a[i-1] < 0 and 0 <= a[i] and a[i+1] < 0:
        a[i-1] = abs(a[i-1])
        a[i+1] = abs(a[i+1])
    elif a[i-1] < 0 and a[i] < 0:
        a[i-1] = abs(a[i-1])
        a[i] = abs(a[i])
    elif a[i] < a[i+1]:
        if abs(a[i]) >= abs(a[i+1]):
            a[i] = a[i]*-1
            a[i+1] = a[i+1]*-1
    elif a[i-1] < a[i]:
        if abs(a[i-1]) >= abs(a[i]):
            a[i-1] = a[i-1]*-1
            a[i] = a[i]*-1
    else:
        continue
print(sum(a))

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split(" ")))
if len(list(filter(lambda x: x < 0, a))) % 2 == 0:
    print(sum(list(map(abs, a))))
else:
    a = list(map(abs, a))
    print(sum(a) - min(a)*2)
n,m=int(input())

if n>=3 and m>=3:
  a=n*m
  b=n*2+m*2-4
elif n==1 or m==1:
  a=n*m
  b=2
elif n==2 or m==2:
  a=0
  b=0
  
print(a-b)

### FIXED CODE ###

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

if n>=3 and m>=3:
  a=n*m
  b=n*2+m*2-4
  ans=a-b
elif n==1 and m==1:
  ans=1
elif n==1 or m==1:
  a=n*m
  b=2
  ans=a-b
elif n==2 or m==2:
  ans=0
  
print(ans)
x, n = map(int, input().split())

if n == 0:
    print(x)
    exit()
P = list(map(int, input().split()))

for s in range(1, 101):
    if s not in P:
        ans = s
        break

for s in range(1, 101):
    if s not in P:
        if abs(ans-x) > abs(s-x):
            ans = s
        elif abs(ans-x) == abs(s-x):
            ans = min(ans, s)

print(ans)


### FIXED CODE ###

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

if n == 0:
    print(x)
    exit()
P = list(map(int, input().split()))

for s in range(-101, 110):
    if s not in P:
        ans = s
        break

for s in range(-101, 110):
    if s not in P:
        if abs(ans-x) > abs(s-x):
            ans = s
        elif abs(ans-x) == abs(s-x):
            ans = min(ans, s)

print(ans)
a,k=map(int,input().split())
L=list(map(int,input().split()))
ans=0

for i in range(min(k,n)+1):
  for j in range(min(k,n)-i+1):
    S=[0]+L[:i]+L[a-j:]
    S.sort()
    x=0
    while x < k-(j+i):
      if S[x]>=0:
        break
      x+=1
    ans=max(ans,sum(S)-sum(S[:x]))
    
print(ans)


### FIXED CODE ###

a,k=map(int,input().split())
L=list(map(int,input().split()))
ans=0

for i in range(min(k,a)+1):
  for j in range(min(k,a)-i+1):
    S=[0]+L[:i]+L[a-j:]
    S.sort()
    x=0
    while x < k-(j+i):
      if S[x]>=0:
        break
      x+=1
    ans=max(ans,sum(S)-sum(S[:x]))
    
print(ans)
import math

def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append([b, e])
        b, e = b + 1, 0
    if n > 1:
        fct.append([n, 1])
    return fct

n = int(input())
mod = 10 ** 9 + 7

l = [0] * (n + 1)

for i in ranfge(1, n + 1):
  soi = factorize(i)
  for j in range(len(soi)):
    l[soi[j][0]] += soi[j][1]

ans = 1
for i in range(1, n + 1):
  ans = ans * (l[i] + 1) % mod

print(ans)


### FIXED CODE ###

import math
 
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append([b, e])
        b, e = b + 1, 0
    if n > 1:
        fct.append([n, 1])
    return fct
 
n = int(input())
mod = 10 ** 9 + 7
 
l = [0] * (n + 1)
 
for i in range(1, n + 1):
  soi = factorize(i)
  for j in range(len(soi)):
    l[soi[j][0]] += soi[j][1]
 
ans = 1
for i in range(1, n + 1):
  ans = ans * (l[i] + 1) % mod
 
print(ans)
n,a,b=map(int,input().split())
    
if n==1:    
    if a==b:
        print(1)
    else:
        print(0)
elif n==2:
    if b<a:
        print(0)
    else:
        print(1)
else:
    if b<a:
        print(0)
    else:
        print(sum(list(range(b-a+2))[::-1][:n-2]))

### FIXED CODE ###

n,a,b=map(int,input().split())
if b<a:
    print(0)
elif n==1:
    if a==b:
        print(1)
    else:
        print(0)
else:
    print( a+b*(n-1) - (a*(n-1)+b) +1 )
N = int(input())
A = list(map(int, input().split()))

ans = 0
def main(i, A):
  global N
  global ans
  if A[i] == A[i+1]:
    if i == N-2:
      ans += 1
      return ans
    else:
      return main(i+1, A)
  elif A[i] < A[i+1]:
    while i < N-1:
      if A[i] <= A[i+1]:
        i += 1
      else:
        ans += 1
        if i == N-2:
          ans += 1
          return ans
        else:
          return main(i+1, A)
    else:
      ans += 1
      return ans
  else:
    while i < N-1:
      if A[i] >= A[i+1]:
        i += 1
      else:
        ans += 1
        if i == N-2:
          ans += 1
          return ans
        else:
          return main(i+1, A)
    else:
      ans += 1
      return ans
    
if N == 1:
  print(1)
else:
  print(main(0, A))

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)
N = int(input())
A = list(map(int, input().split()))

ans = 0
def main(i, A):
  global N
  global ans
  if A[i] == A[i+1]:
    if i == N-2:
      ans += 1
      return ans
    else:
      return main(i+1, A)
  elif A[i] < A[i+1]:
    while i < N-1:
      if A[i] <= A[i+1]:
        i += 1
      else:
        ans += 1
        if i == N-2:
          ans += 1
          return ans
        else:
          return main(i+1, A)
    else:
      ans += 1
      return ans
  else:
    while i < N-1:
      if A[i] >= A[i+1]:
        i += 1
      else:
        ans += 1
        if i == N-2:
          ans += 1
          return ans
        else:
          return main(i+1, A)
    else:
      ans += 1
      return ans
    
if N == 1:
  print(1)
else:
  print(main(0, A))
N = int(input())
S = list(input())

ans = ""
for a in S:
    ans += chr((ord(a) + N) % 26 - ord("A"))

print(ans)

### FIXED CODE ###

N = int(input())
S = list(input())

ans = ""
for a in S:
    ans += chr((ord(a) + N - ord("A")) % 26 + ord("A"))

print(ans)
s=[input() for i in range(3)]
l=[len(s[i]) for i in range(3)]
abc=[0,0,0]
now=0
while True:
    if len(now)==abc[now]:
        break
    s_sub=s[now][abc[now]]
    now=(0 if s_sub=="a" else 1 if s_sub=="b" else 2)
    abc[now]+=1
print("A" if now==0 else "B" if now==1 else "C")

### FIXED CODE ###

#オブジェクト指向忘れてた
#関数内は別物、参照作成なので
#def next_turn(s):
#    s0=s[0]
#    s=s[1:]
#    return s0

sa=input()
sb=input()
sc=input()

k=sa[0]
sa=sa[1:]
while True:
    #print(sa)
    #print(sb)
    #print(sc)
    if k=="a":
        if len(sa)==0:
            print("A")
            break
        else:
            k=sa[0]
            sa=sa[1:]
    elif k=="b":
        if len(sb)==0:
            print("B")
            break
        else:
            k=sb[0]
            sb=sb[1:]
    else:
        if len(sc)==0:
            print("C")
            break
        else:
            k=sc[0]
            sc=sc[1:]
a, b, c, k = list(map(int, input().split()))

cards = [1]*a + [0]*b + [-1]*c
print(sum(cards[:k]))

### FIXED CODE ###

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

left = k
sum = 0
cards = (a, b, c)

for i, card in enumerate(cards):
  if card <= left:
    sum += card * (1-i)
    left -= card
  elif left > 0:
    sum += left * (1-i)
    left = 0

print(sum)
l,r=map(int,input().split())
s=list(range(l,r+1))
ans=2018
for i in range(r-l):
    for j in range(i+1,r-l+1):
        ans=min((s[i]%2019)*(s[j]%2019),ans)
        if ans==0:
            break
print(ans)

### FIXED CODE ###

l,r=[int(i) for i in input().split()]
ans=2018
for i in range(l,r):
    for j in range(i+1,r+1):
        ans=min(i*j%2019,ans)
        if ans==0:
            print(ans)
            exit()
print(ans)
from math import cos
a,b,h,m = map(int, input().split())
p = 3.14159265358979323846264338327950
tot_min = h*60 + m 
tot_sec = tot_min * 60 
 
h_angle = float("{:.25f}".format((tot_sec*pi)/(6*3600)))
m_angle = float("{:.25f}".format((tot_sec*pi)/(1800)))
 
while h_angle > 2*p:
    h_angle-=2*p 
while m_angle > 2*p:
    m_angle-=2*p 
r = abs(h_angle - m_angle)
if r > p:
    r-=p 
c = float("{:.25f}".format(cos(r)))
ans = float("{:.25f}".format(a**2 + b**2 -2*a*b*c))
ans = float("{:.25f}".format(ans**(0.5)))
print(ans)

### FIXED CODE ###

from math import cos
a,b,h,m = map(int, input().split())
p = 3.14159265358979323846264338327950

rad = h/12.0 + m/(60*12) - m/60.0
rad = 2*p * rad

ans = a**2 + b**2 -2*a*b*cos(rad)
 

print(ans**(0.5))
S = input()
A = 0
B = []
for i in S:
  if i == 'A' or i == 'C' or i == 'G' or i == 'T':
    A += 1
  else:
    B.append(A)
    A = 0

print(max(B))

### FIXED CODE ###

s = str(input())
m = ['A','G','C','T']
ans = 0
cnt = 0
for c in s:
    if c in m:
        cnt += 1
    else:
        ans = max(cnt,ans)
        cnt = 0
else:
    ans = max(cnt,ans)
print(ans)
a,b=map(int,input().split())
s=list(map(int,input().split()))
ans=[]
for i in range(b-1):
    ans.append(s[i+1]-s[i])
ans.append(a-s[b]+s[0])
print(a-max(ans))







### FIXED CODE ###

a,b=map(int,input().split())
s=list(map(int,input().split()))
ans=[]
for i in range(b-1):
    ans.append(s[i+1]-s[i])
ans.append(a-s[b-1]+s[0])
print(a-max(ans))
#import sys
#stdin = sys.stdin

def li(): return [int(x) for x in stdin.readline().split()]
def li_(): return [int(x)-1 for x in stdin.readline().split()]
def lf(): return [float(x) for x in stdin.readline().split()]
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(ns())
def nf(): return float(ns())

from itertools import accumulate

n,w = li()
wi,vi = li()
w0 = wi
v_list = [[0] for _ in range(4)]
v_list[0].append(vi)

for _ in range(n-1):
    wi,vi = li()
    v_list[wi-w0].append(vi)
    
for i in range(4):
    v_list[i].sort(reverse=True)
    v_list[i] = list(accumulate(v_list[i]))
    
ans = 0
res = w
for w1 in range(len(v_list[0])):
    
    if w - w0*(w1) < 0:
        pass
    else:
        res1 = w - w0*(w1)
        ans1 = v_list[0][w1]
        ans = max(ans, ans1)
    

    for w2 in range(len(v_list[1])):

        if res1 - (w0+1)*(w2) < 0:
            pass
        
        else:
            res2 = res1 - (w0+1)*(w2)
            ans2 = ans1 + v_list[1][w2]
            ans = max(ans, ans2)

        
        
        for w3 in range(len(v_list[2])):
            
            if res2 - (w0+2)*(w3) < 0:
                pass
            
            else:
                res3 = res2 - (w0+2)*(w3)
                ans3 = ans2 + v_list[2][w3]
                ans = max(ans, ans3)
                
            
            for w4 in range(len(v_list[3])):

                if res3 - (w0+3)*(w4) < 0:
                    pass
                
                else:
                    res4 = res3 - (w0+3)*(w4)
                    ans4 = ans3 + v_list[3][w4]
                    ans = max(ans, ans4)

                
print(ans)

### FIXED CODE ###


from collections import defaultdict

N,W = map(int, input().split())
WV = []
for i in range(N):
    WV.append(list(map(int, input().split())))

dp = defaultdict(int)

dp[0] = 0

for w,v in WV:
    for nw, nv in list(dp.items()):
        if nw+w <= W:
            dp[nw+w] = max(dp[nw+w], nv+v)
            
print(max(dp.values()))
a,b=map(int,input().split())
list_s=[]
list_s.append=map(int,input().split())

print(list_s>=b)

### FIXED CODE ###

a,b=map(int,input().split())
d=0
c=list(map(int,input().split()))
for i in range(a):
  if c[i]>=b:
    d+=1
  else:
    pass
print(d)
import collections
n=int(input())
a=list(map(int,input().split()))
a=collections.Counter(a)
b,c=[],[]
for t in a:
  if a[t]==1:
    b.append(t)
  else:
    c.append(t)
if len(b) == 0:
  print(0)
  exit()
b.sort()
bm = b[-1]
ok = [True]*(bm+1)

if len(c)>0:
  c.sort()
  for t in c:
    if ok[t] == False: continue
    i = 1
    while i*t<=bm:
      ok[i*t]=False
      i+=1
for t in b:
  if ok[t] == False: continue
  i = 2
  while i*t<=bm:
    ok[i*t]=False
    i+=1
ans = 0
for t in b:
  if ok[t]:
    ans+=1
print(ans)  

### FIXED CODE ###

import collections
n=int(input())
a=list(map(int,input().split()))
a=collections.Counter(a)
b,c=[],[]
for t in a:
  if a[t]==1:
    b.append(t)
  else:
    c.append(t)
if len(b) == 0:
  print(0)
  exit()
b.sort()
bm = b[-1]
ok = [True]*(bm+1)

if len(c)>0:
  c.sort()
  for t in c:
    if t>=bm: continue
    if ok[t] == False: continue
    i = 1
    while i*t<=bm:
      ok[i*t]=False
      i+=1
for t in b:
  if ok[t] == False: continue
  i = 2
  while i*t<=bm:
    ok[i*t]=False
    i+=1
ans = 0
for t in b:
  if ok[t]:
    ans+=1
print(ans)
a,b = map(int,inout().split())
print(a+b if b%a == 0 else b-a)

### FIXED CODE ###

a,b = map(int,input().split())
print(a+b if b%a == 0 else b-a)
s = int(input())
w = int(input())
if w>=s:
  print("unsafe")
else:
  print("safe")

### FIXED CODE ###

s,w= map(int,input().split())
if w>=s:
  print('unsafe')
else:
  print('safe')
a=list(map(int,input().split()))
print("A"+a[1][0]+"C")


### FIXED CODE ###

a=list(map(str,input().split()))
print("A"+a[1][0]+"C")