Codeforces Round #480 (Div. 2): C. Posterized(贪心)

NoSuchKey