题目大意 有一颗树,要为每个节点赋一个值\(l_i\leq a_i\leq r_i\),使得任意相邻的节点互素.然后对每个节点统计\(a_i\)在所有可能的情况中的和. \(n\leq 50,1\leq l_i\leq r_i\leq m,m=50000\) 题解 设\(f_{i,j}\)为以\(i\)为根的子树都赋了值后\(a_i=j\)的方案数.那么怎么处理\(f_v\)对\(f_i\)的贡献呢? \[ g_i=\mu(i)\sum_{i|j}f_{v,j}\\ f_{x,i}\times=…