import numpy as np M=loadtxt(open(0),"q") N,W=M[0];v,w=M[1:].T import scipy as sc print(-int(sc.optimize.linprog(-v,[w.T],W,integrality=1).fun))