#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include #define rep(i,n) for(int i=0;i<(n);i++) #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define sz(x) ((int)(x).size()) #define pb push_back using ll = long long; using namespace std; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> N >> D; vector A(N,0); rep(i,N) if(i) cin >> A[i]; vector sums(N,0); rep(i,N-1) sums[i+1] = sums[i] + A[i+1]; cout << 0; rep(i,N){ if(i){ chmax(sums[i],sums[i-1]+D); cout << ' ' << sums[i]; } } cout << endl; return 0; }