Codeforces Problem - 39E - What Has Dirichlet Got to Do with That?(博弈,记忆化搜索)

NoSuchKey