bzoj#P1762. [Baltic2009] Candy

[Baltic2009] Candy

本题已重题,题目链接:link