Comments

Yes, the key is to isolate the terms that depend on where the detour off the shortest path starts, and then find the minimum of these terms using binary lifting. Of course, there are many more details to what I've just described, but I will leave that for you to figure out.

The second counterexample proves that your edit is also incorrect. It would be nice if you could read the comment before replying.

vc<W> unko;

I guess even LGMs do this sometimes, on FHC Finals nonetheless xD

Gratz on the solve tho