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

dp = [[0 for _ in range(n + 1)] for _ in range(m + 1)]

for i in range(m + 1):
    for j in range(n + 1):
        if i == 0 and j == 0:
            dp[i][j] = 0
        elif i == 0:
            dp[i][j] = 1000000000
        elif j == 0:
            dp[i][j] = 0
        else:
            if j - c[i - 1] >= 0:
                dp[i][j] = min(dp[i - 1][j], dp[i][j - c[i - 1]] + 1)
            else:
                dp[i][j] = dp[i - 1][j]

ans = 10 ** 10
for i in range(m + 1):
    ans = min(ans, dp[i][n])
print(ans) n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m c = list(map(int, input().split())) c list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split [0 for _ in range(n + 1)] for _ in range(m + 1) for _ in range(m + 1) _ range(m + 1) range m + 1 m 1 for _ in range(m + 1) [0 for _ in range(n + 1)] dp = [[0 for _ in range(n + 1)] for _ in range(m + 1)] dp [[0 for _ in range(n + 1)] for _ in range(m + 1)] for i in range(m + 1):
    for j in range(n + 1):
        if i == 0 and j == 0:
            dp[i][j] = 0
        elif i == 0:
            dp[i][j] = 1000000000
        elif j == 0:
            dp[i][j] = 0
        else:
            if j - c[i - 1] >= 0:
                dp[i][j] = min(dp[i - 1][j], dp[i][j - c[i - 1]] + 1)
            else:
                dp[i][j] = dp[i - 1][j] i range(m + 1) range m + 1 m 1 for j in range(n + 1):
        if i == 0 and j == 0:
            dp[i][j] = 0
        elif i == 0:
            dp[i][j] = 1000000000
        elif j == 0:
            dp[i][j] = 0
        else:
            if j - c[i - 1] >= 0:
                dp[i][j] = min(dp[i - 1][j], dp[i][j - c[i - 1]] + 1)
            else:
                dp[i][j] = dp[i - 1][j] j range(n + 1) range n + 1 n 1 if i == 0 and j == 0:
            dp[i][j] = 0
        elif i == 0:
            dp[i][j] = 1000000000
        elif j == 0:
            dp[i][j] = 0
        else:
            if j - c[i - 1] >= 0:
                dp[i][j] = min(dp[i - 1][j], dp[i][j - c[i - 1]] + 1)
            else:
                dp[i][j] = dp[i - 1][j] i == 0 and j == 0 i == 0 i 0 j == 0 j 0 dp[i][j] = 0 dp[i][j] [i] dp i j 0 elif i == 0:
            dp[i][j] = 1000000000
         i == 0 i 0 dp[i][j] = 1000000000 dp[i][j] [i] dp i j 1000000000 elif j == 0:
            dp[i][j] = 0
         j == 0 j 0 dp[i][j] = 0 dp[i][j] [i] dp i j 0 if j - c[i - 1] >= 0:
                dp[i][j] = min(dp[i - 1][j], dp[i][j - c[i - 1]] + 1)
            else:
                dp[i][j] = dp[i - 1][j] j - c[i - 1] >= 0 j - c[i - 1] j c[i - 1] c i - 1 i 1 0 dp[i][j] = min(dp[i - 1][j], dp[i][j - c[i - 1]] + 1) dp[i][j] [i] dp i j min(dp[i - 1][j], dp[i][j - c[i - 1]] + 1) min dp[i - 1][j] [i - 1] dp i - 1 i 1 j dp[i][j - c[i - 1]] + 1 dp[i][j - c[i - 1]] [i] dp i j - c[i - 1] j c[i - 1] c i - 1 i 1 1 dp[i][j] = dp[i - 1][j] dp[i][j] [i] dp i j dp[i - 1][j] [i - 1] dp i - 1 i 1 j ans = 10 ** 10 ans 10 ** 10 10 10 for i in range(m + 1):
    ans = min(ans, dp[i][n]) i range(m + 1) range m + 1 m 1 ans = min(ans, dp[i][n]) ans min(ans, dp[i][n]) min ans dp[i][n] [i] dp i n print(ans) print ans m = map(int, input().split()) map(int, input().split()) m ans = 10 ** 10 10 ** 10 ans dp = [[0 for _ in range(n + 1)] for _ in range(m + 1)] [[0 for _ in range(n + 1)] for _ in range(m + 1)] dp n, m = map(int, input().split()) map(int, input().split()) n c = list(map(int, input().split())) list(map(int, input().split())) c ans = min(ans, dp[i][n]) min(ans, dp[i][n]) ans
n, m = map(int, input().split())
c = list(map(int, input().split()))

dp = [[0 for _ in range(n + 1)] for _ in range(m + 1)]

for i in range(m + 1):
    for j in range(n + 1):
        if i == 0 and j == 0:
            dp[i][j] = 0
        elif i == 0:
            dp[i][j] = 1000000000
        elif j == 0:
            dp[i][j] = 0
        else:
            if j - c[i - 1] >= 0:
                dp[i][j] = min(dp[i - 1][j], dp[i][j - c[i - 1]] + 1)
            else:
                dp[i][j] = dp[i - 1][j]

ans = 10 ** 10
for i in range(m + 1):
    ans = min(ans, dp[i][n])
print(ans)
