Codeforces Round #519D. Mysterious Crime(模拟+递推)

NoSuchKey