Codeforces #358 Div2 C. Alyona and the Tree

ミスが多い。 http://codeforces.com/contest/682/problem/C