Static Range Sum with Upper Bound