#include using namespace std; int main() { int n, x; cin >> n >> x; vector l(x + 1); for (int i = 0; i < n; i++) { int a, b; cin >> a >> b; for (int j = 1; j <= x; j++) { l[j] = max(l[j], max(b - abs(j - a), 0)); } } for (int i = 1; i <= x; i++) { cout << l[i] << " "; } cout << endl; }