#include using namespace std; int main () { int N, W; cin >> N >> W; int dp[110][100010]; for (int i = 0; i <= W; i ++) { dp[0][i] = 0; } for (int i = 0; i < N; i ++) { int w, v; cin >> w >> v; for (int j = 0; j <= W; j ++) { dp[i + 1][j] = dp[i][j]; if (j >= w) { dp[i + 1][j] = max(dp[i][j], dp[i][j - w] + v); } if (j) { dp[i + 1][j] = max(dp[i + 1][j], dp[i + 1][j - 1]); } } } for (int i = 1; i <= W; i ++) { cout << dp[N][W] - dp[N][W - i] + 1 << endl; } }