#include using namespace std; using ll =long long; #define all(v) v.begin(),v.end() #define rep(i,a,b) for(int i=a;i=b;i--) int main() { ll N,W;cin>>N>>W; vector w(N),v(N); for(ll i=0;i>w[i]>>v[i]; } vector> dp(N+2,vector (W+1,0)); for(ll i=1;i<=N;i++) { for(ll j=0;j<=W;j++) { dp[i][j]=dp[i-1][j]; if(j-w[i-1]>=0) { dp[i][j]=max(dp[i][j],dp[i-1][j-w[i-1]]+v[i-1]); } } } for(ll i=1;i<=W;i++) { cout<