Codeforces Round #551 (Div. 2) D 树形dp

NoSuchKey