codeforces:B2. K for the Price of One (Hard Version)(简易DP)

NoSuchKey