SEGMENT TREES HELP

I want help regarding implementation of all segment tree operations over a vector of pairs and maintain a count of required values which are within a range if antone have done it before or have code regarding it please help…

You can give this a try https://github.com/kartik8800/segTree .
SegmentTree<pair<int,int>> segtre();