#include using namespace std; #ifdef _RUTHEN #include #else #define show(...) true #endif using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) template using V = vector; int main() { ios::sync_with_stdio(false); cin.tie(0); int N, W; cin >> N >> W; V w(N), v(N); rep(i, N) cin >> w[i] >> v[i]; constexpr int INF = 1 << 30; V dp(W + 1, -INF); dp[0] = 0; rep(i, N) { for (int j = W - w[i]; j >= 0; j--) { dp[j + w[i]] = max(dp[j + w[i]], dp[j] + v[i]); } } for (int i = 0; i < W; i++) dp[i + 1] = max(dp[i + 1], dp[i]); for (int x = 1; x <= W; x++) cout << dp[W] - dp[W - x] + 1 << '\n'; return 0; }