## Little Elephant and Lemonade : CodeChef Problem LELEMON

There are n rooms (numbered from 0 to n-1), each contains $C_i$ bottles. Each bottle has a volume (in litres). The first room visited by Little Elephant was $P_0$th, the second $P_1$th, …, the m-th $P_{m-1}$th room. Note that Little Elephant may visit a room more than once.