codeforces 1282B2. K for the Price of One (Hard Version) (dp)

NoSuchKey