Codeforces Round #693 (Div. 3) G. Moving to the Capital dp + 思维

NoSuchKey