Mike and OR Tree Unable to thnk of any approach

pls help by pointing to the approach

reply pls i need help regarding this question

sorry, i will make it today and tell you by the evening.

first you can use heavy light decomposition, decompose the tree and then find the left most 1 using segment tree,
it is similar to the question https://www.spoj.com/problems/QTREE3/

also you can decompose query into sqrt parts and use bfs for every part, and also you can use centroid decomposition on the tree

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.