ac poj_2104(using functional segment tree!!!)
ac poj_2686