Given a rooted tree with weighted edges, you start at the root at time $$$T$$$ and move down along the children. When you are at a node $$$u$$$, and the current time is $$$m$$$, you move to the child with index $$$m \% d$$$ where $$$d$$$ is the number of children of $$$u$$$. You would take time $$$w$$$ to reach that child, where $$$w$$$ is the edge weight between them.
Given several queries, determine which leaf vertex would you arrive at for a given $$$T$$$?
I created a video discussing the ideas used in this problem







