#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #define _GLIBCXX_DEBUG #else #define Debug(...) void(0) #endif using ll = long long; #define rep(i, n) for (int i = 0; i < (n); ++i) int main() { int n,x;cin>>n>>x; vector> v(n); rep(i,n) cin >> v[i].first >> v[i].second; vector ans(x, 0); rep(i,x) { rep(j, n) { ans[i] = max(ans[i], v[j].second - abs((i + 1) - v[j].first)); } } rep(i, x) cout << ans[i] << " "; cout << endl; return 0; }