#include using namespace std; int main() { int N, X; cin >> N >> X; vector A(N), B(N); for (int i = 0; i < N; i++) { cin >> A[i] >> B[i]; A[i]--; } vector ans(X); for (int i = 0; i < N; i++) { for (int x = 0; x < X; x++) { int tmp = max(B[i] - abs(x - A[i]), 0); ans[x] = max(ans[x], tmp); } } for (int i = 0; i < X; i++) { cout << ans[i] << " "; } cout << endl; }