include [HTML_REMOVED]
include [HTML_REMOVED]
include [HTML_REMOVED]
include [HTML_REMOVED]
include [HTML_REMOVED]
using namespace std;
int f[1010];
int a[1010];
int b[1010];
int main()
{
int n,v;
scanf(“%d%d”,&n,&v);
for(int i=0;i<n;i)
{
int vv,w;
scanf(“%d%d”,&vv,&w);
for(int j=vv;j<=v;j)
{
f[j]=max(f[j],f[j-vv]+w);
}
}
cout<<f[v]<<endl;
return 0;
}