Segment Tree Query II(LintCode 247):

Problem