2008-2009 ACM-ICPC, NEERC, Southern Subregional Contest
link How to solve B, C? For C i know the solution with 2D-segment tree with lazy propagation, but it looks too scary.