import pulp W = [] L = int(input()) #箱の幅 N = int(input()) #ブロックの数 W = input().split() #各ブロックの幅 problem = pulp.LpProblem('No.5', pulp.LpMaximize) # 最大化する場合 xs = range(N) x = pulp.LpVariable.dicts("x", (xs), 0, 1, pulp.LpInteger) problem += pulp.lpSum([x[i]]for i in range(N)) problem += pulp.lpSum([int(W[i])*x[i]for i in range(N)]) <= L problem.solve() status = problem.solve() print(pulp.LpStatus[status]) print("Result") count = 0 for i in range(N): count += x[i].value() print(int(count))