#include #include #include using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 4000000000000000001 int main(){ int n,w; cin>>n>>w; vector dp(w+1,0); rep(i,n){ vector ndp(w+1,-Inf64); int x,y; cin>>x>>y; rep(j,w+1){ if(dp[j]<0)continue; ndp[j] = max(ndp[j],dp[j]); if(j+x<=w){ ndp[j+x] = max(ndp[j+x],dp[j]+y); } } swap(dp,ndp); } for(int i=1;i<=w;i++){ cout<