UNIQUE VISION Programming Contest 2022(AtCoder Beginner Contest 248)G.GCD cost on the tree(反演/容斥)
题目n(nusingnamespacestd;constintN=1e5+10,M=1e5,mod=998244353;intn,u,v,phi[N],a[N],sz[N],all,ans,cnt;boolvis[N];vectore[N],fac[N],h[N];vectornow;structedge{intu,v;}f[N];voiddfs(intu,intfa){all++;vis[u]=