update (bit2, l, v * (l - 1)); update (bit2, r + 1, -v * r); ...
A place to organize my solutions to a lot of programming contest problems - atarw/programming-contest-solutions ...