#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; ll dp[110][100100]; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int n,w; cin>>n>>w; vector W(n+1),V(n+1); rep(i,n) cin>>W[i+1]>>V[i+1]; for(int i=1;i<=n;i++){ for(int j=0;j<=w;j++){ dp[i][j]=dp[i-1][j]; if(j-W[i]>=0) dp[i][j]=max(dp[i][j],dp[i-1][j-W[i]]+V[i]); } } for(int i=1;i<=w;i++){ cout<