did you got the solution - pls share…
i understood this problem requires us to do preprocessing so when we query - we can use pre created vector which stores the sum of flowers starting from node V to node U(ancestor of V)
but can’t do this for each pair (U,V) so i think we should only do this for each pair (1,x) - and such vector for (U,V) can be written in terms of (1, V) , (1, U) and we can use binary search to find index where our suffix sum become greater than required
but how to handle point updates ?