Codeforces Round #642 (Div. 3) E—K-periodic Garland dp

NoSuchKey