oortschun2009-08-31 08:23:09I know it is gonna be solved with segment trees. I have read the tutorial in TopCoder and understood it but could not find any way to modify it for that problem. Any help will be appreciated.