#include using namespace std; #define int long long signed main(){ int N,X; cin >> N >> X; vector A(N); vector B(N); vector data(X+1,0); for(int i=0;i> A[i] >> B[i]; data[A[i]]=max(data[A[i]],B[i]); for(int j=1;j=0){ data[A[i]-j]=max(data[A[i]-j],B[i]-j); } if(A[i]+j<=X){ data[A[i]+j]=max(data[A[i]+j],B[i]-j); } } } for(int i=1;i<=X;i++){ cout << data[i] << " "; } cout << endl; }