CF893F Subtree Minimum Query
Description
You are given a rooted tree consisting of $ n $ vertices. Each vertex has a number written on it; number $ a_{i} $ is written on vertex $ i $ .
Let's denote $ d(i,j) $ as the distance between vertices $ i $ and $ j $ in the tree (that is, the number of edges in the shortest path from $ i $ to $ j $ ). Also let's denote the $ k $ -blocked subtree of vertex $ x $ as the set of vertices $ y $ such that both these conditions are met:
- $ x $ is an ancestor of $ y $ (every vertex is an ancestor of itself);
- $ d(x,y)
Input Format
N/A
Output Format
N/A