I have a question with a lot of queries which are of four types:
Add to range.
Initialize a range.
Multiply a range with scalar.
Find running sum over a range.
Since queries are in huge numbers I have to use segment tree with lazy propagation but I am stuck on how to use lazy propagation on more than 2 types of queries. How would I be able to identify that when updates are to be made later, then what type of update(i.e. addition, multiplication, initializing) is to be made?
1.2.3. This is the simple initialization and update part.
4.This is the query part:
And from
main**After your comment: