#include using namespace std; using ll = long long; ll op(ll a, ll b) { return max(a, b); } ll e() { return -8e18; } ll ma(ll f, ll x) { return f + x; } ll co(ll f, ll g) { return f + g; } ll id() { return 0; } int main() { int n, m; cin >> n; vector v(n - 1); for (int i = 0; i < n - 1; ++i) { cin >> v[i]; v[i] += (n - i - 1) * 3; } atcoder::lazy_segtree seg(v); for (cin >> m; m--;) { ll l, r, d; cin >> l >> r >> d; seg.apply(l - 1, r, d); cout << seg.all_prod() << '\n'; } }