Dynamic array updated by adding arithmetic progressions
Hint: find a data structure that supports these three basic operations:


Given $l,r,b$, for each $i \in \{l,\dots,r\}$, increase $a_i$ by $b$.
Given $l,r,d$, for each $i \in \{l,\dots,r\}$, increase $a_i$ by $id$.
Given $l,r$, compute $\sum_{i=l}^r a_i$.


You can then use those basic operations to implement your operation 1.

Can you think of any way to support basic operations 1+3?  Can you think of any way to support basic operations 2+3?  If you can answer both of those questions with a "yes", you will probably then be able to solve your problem.