#include template bool chmax(T &a, const T &x) { return x > a ? a = x, true : false; } int main() { int N, X; std::cin >> N >> X; std::vector L(X+1); while (N--) { int A, B; std::cin >> A >> B; for (int x = 1; x <= X; ++x) chmax(L[x], std::max(B - std::abs(x - A), 0)); } for (size_t i = 1; i < L.size(); ++i) std::cout << L[i] << " \n"[i+1 == L.size()]; }