Sorry for the question post, but I've spent 2 hours on the recent Div 2 B (1786B - Производство тортов) and it seems I just don't understand the problem statement. Correct solutions to the test case:

1

3 3 1

3 10 25

7 23 27

return "NO," but according to my interpretation, it should be "YES". The dispenser at position 7 gives chocolate to the cakes at position 3 and 10, and the dispensers at position 23 and position 27 give chocolate to the cake at position 25. Also correct solutions don't seem to consider at all the case where one dispenser covers two cakes and two dispensers cover one cake. Is it mentioned somewhere in the problem statement this won't happen?

Could someone point out the flaw in my logic/interpretation? Thank you!