#include #include #include #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]; vector l(x + 1, 0); for (int i = 1; i <= x; i++) { for (int j = 0; j < n; j++) { l[i] = max({0, b[j] - abs(a[j] - i), l[i]}); } } for (int i = 1; i <= x; i++) { if (i != 1) cout << " "; cout << l[i]; } cout << endl; }