seg-tree from BSR