lca的部分判断的是
if (dep[top[x]] < dep[top[y]])swap(x , y);
而不是
if (dep[x] < dep[y]])swap(x , y);
输入的时候记得给点权取模