Interval Sum II(LintCode 207):

Problem