Segment tree problems