I've been thinking about this problem a couple of days now, and I couldn't solve it, can you please help me?
Given N companies, M sectors (sectors are adjacent and circular m is adjacent to 1) and Q queries
each query L,R, X means that sectors in the range [L,R] will get +X meteors each
Each sector is owned by a company and gets all meteors that fall in it
Each company wants to collect a certain amount of meteors.
output for each company the time when it collected the amount it wanted..(The number of the last query it required)
N<=3*10^5,M<=3*10^5, Queries <=3*10^5
Full text and comments »