Codeforces Round #588 (Div. 2)-E. Kamil and Making a Stream-求树上同一直径上两两节点之间gcd的和
CodeforcesRound#588(Div.2)-E.KamilandMakingaStream-求树上同一直径上两两节点之间gcd的和【ProblemDescription】给你一棵树,树上每个节点都有一个权值。定义\(1\simv\)的最短路径所经过的所有节点\(u\)称为\(v\)节点的祖先。定义函数\(f(u,v)=gcd(u,t1,t2,\dots,v)\),其中\(u,t1,t2,