Are you bored of writing duplicate codes when solving segment tree problems?
Did you find that segment trees have very little difference from each other?
Do you want a template, which allows you to code only the key parts, the parts different from other segment trees?
Then this template may help.
An example of segment add & multiply, segment query for sum modulo p:
codes
For more information (how to use it), please read README.md on Github.