#pragma GCC optimize("Ofast") #include using namespace std; typedef long long int ll; typedef unsigned long long int ull; mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); ll myRand(ll B) { return (ull)rng() % B; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n, x; cin >> n >> x; vector res(x); for (int i = 0; i < n; i++) { int a, b; cin >> a >> b; a -= 1; for (int j = 0; j < x; j++) { res[j] = max(res[j], b - abs(a - j)); } } for (int i = 0; i < x; i++) { cout << res[i] << " "; } cout << endl; }