from scipy.optimize import linprog # linprogはminimizeを計算するので金額を負値にする c = [-1000, -2000] A = [[3 / 4, 2 / 7], [1 / 4, 5 / 7]] B = list(map(int, input().split())) bounds = [(0, None), (0, None)] res = linprog(c, A_ub=A, b_ub=B, bounds=bounds, method='highs') print(-res.fun)