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