Codeforces Round #476 (Div. 2) [Thanks, Telegram!] C. Greedy Arkady(brute force/math)

NoSuchKey