Centroid & Heavy-light decomposition

Нажмите на ссылку https://codeforces.com/gym/271198, чтобы открыть ресурс.