dp, segment_tree