you give rooted tree consist n vertex each vertex number write number ai write vertex ilet denote dij distance vertice j tree number edge short path j also let denote kblocke subtree vertex x set vertex y condition meet x ancestor y vertex ancestor dxyk you give m query tree ith query represent number xi ki answer query minimum value aj vertex j j belong kiblocked subtree xiWrite program process query quicklynote query give modified way