Codeforces Round #646 (Div. 2)F. Rotating Substrings(dp)

NoSuchKey