I need a way to find solve this :
Given array, use one of two operations. add k to all elements in a given interval, find sum of values in a given interval (both range update and range query simultaneously). I know how to do it using Fenwick tree data structure. I need it using segment tree. Can any one please provide a link to a tutorial?
in reference to the problem : http://www.spoj.com/problems/HORRIBLE/
Can it be done without lazy propagation?
p.s. I found this simple solution http://codeforces.com/blog/entry/6415. Can anyone explain it a bit please? I am confused with two variables in the segment tree. Please help