Codeforces Round #481 (Div. 3) G. Petya's Exams(贪心)

NoSuchKey