Queries to find the Minimum Weight from a Subtree of atmost D-distant Nodes from Node X
Given an N-ary Tree rooted at 1, and an array val[] consisting of weights assigned to every node, and a matrix Q[][], consisting of queries of the form {X, D}, the task for each query is to find the minimum of all weights assigned to the nodes which are atmost at a distance D from the node X. Exampl