import sys
sys.setrecursionlimit(10 ** 7)

n, cap = map(int, input().split())
best = 0
goods = [list(map(int, input().split())) for i in range(n)]
goods.sort(key=lambda x: x[0] / x[1], reverse=True)
v_cum = [0]
def dfs(ind, v, w):
    global best
    if w > cap: return
    if ind == n: best = max(best, v); return
    v_l = v
    w_new = cap - w
    cur = ind
    while cur < n and 0 <= w_new - goods[cur][1]:
        w_new -= goods[cur][1]
        v_l += goods[cur][0]
        cur += 1
    cur -= 1
    if cur == n and w_new == 0: bese = max(best, v_l); return 
    opt = v_l + goods[cur][0] * (w_new / goods[cur][1])
    if opt <= best: return 
    dfs(ind + 1, v + goods[ind][0], w + goods[ind][1])
    dfs(ind + 1, v, w)
for i in range(n): v_cum.append(v_cum[-1] + goods[i][0])
dfs(0, 0, 0)
print(best)