#include #include typedef long long ll; using namespace std; #define rep(i,a,n) for (int i = a; i < (n); i++) template inline bool chmax(T& a, T b) { return ((a < b) ? (a = b, true) : (false)); } template inline bool chmin(T& a, T b) { return ((a > b) ? (a = b, true) : (false)); } int main() { int n,x; cin >> n >> x; vector a(x+10),b(x+10),l(x+10); rep(i,0,n){ cin >> a[i] >> b[i]; rep(j,1,x+1){ int tmp = max(b[i] - abs(j-a[i]),0); chmax(l[j-1], tmp); } } rep(i,0,x){ cout << l[i] << " "; } }