#include #include #include #include #include #include #include #include using namespace std; int main() { int n, d, diff = 0; cin >> n >> d; vector v(n, 0); for (int i = 1; i < n; i++) cin >> v[i]; for (int i = 1; i < n; i++){ if (int t = v[i] - v[i-1] < d){ diff += (d - t); v[i] += diff; } else { v[i] = v[i-1] + v[i]; diff = 0; } } string delim = ""; for (auto x : v){ cout << delim << x; delim = " "; } cout << endl; }