codeforces 501 C. Misha and Forest (思维)

NoSuchKey