classical problem: add delta to all nodes on the path to u->v, it is basically adding delta to u and v, then val[lca(u,v)]-=delta, then just use dfs to find answer.
My question is to ask: is there a way to answer online?
Like let us say we have q<=1e5 queries and n<=1e5: is there a way to find value of a node during queries? (just curious)