Rosetta Problems

GCD cost on the tree

https://atcoder.jp/contests/abc248/tasks/abc248_g