Codeforces Round #505 (rated, Div. 1 + Div. 2)C

NoSuchKey