Segment tree template of utkarsh.

Used with SPOJ HORRIBLE.