#include #include using namespace std; using namespace atcoder; using ll = long long; using vi = vector; using vl = vector; using vs = vector; using vc = vector; using vb = vector; using vpii = vector>; using vpll = vector>; using vvi = vector>; using vvl = vector>; using vvc = vector>; using vvvi = vector>>; using pii = pair; using vvb = vector>; using Graph = vector>; const ll LINF = 1001002003004005006ll; const int INF = 1001001001; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep3(i, m, n) for (int i = (m); i < (int)(n); i++) #define rrep(i, m, n) for (int i = (m); i >= (int)(n); i--) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() template inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); } template inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); } vi dx4 = {1, 0, -1, 0}, dy4 = {0, 1, 0, -1}; vi dx8 = {1, 1, 1, 0, 0, -1, -1, -1}, dy8 = {1, 0, -1, 1, -1, 1, 0, -1}; int main() { int n, x; cin >> n >> x; vi a(n), b(n); rep(i, n) { cin >> a[i] >> b[i]; a[i]--; } vi lp(x, 0); rep(i, n) { rep(j, x) { chmax(lp[j], max(b[i] - abs(j - a[i]), 0)); } } rep(i, x) { cout << lp[i] << ' '; } return 0; }