CF 2067E - White Magic

Rating: 1900
Tags: constructive algorithms, greedy, implementation
Solve time: 2m 32s
Verified: no

Solution

Working