Codeforces Round #638 (Div. 2) E. Phoenix and Berries dp

NoSuchKey