You are given a tree consisting of $$$N$$$ nodes numbered from $$$1$$$ to $$$N$$$, connected by $$$N-1$$$ edges.
You are also given a list of $$$M$$$ distinct "special" nodes. The remaining $$$N-M$$$ nodes are "normal."
You can move between nodes along the tree edges.
For each node $$$i$$$ $$$(1 \le i \le N)$$$, determine the maximum number of distinct nodes that can be visited in a single continuous journey starting from node $$$i$$$.
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 2 \cdot 10^5$$$), the number of test cases. The description of each test case follows:
It is guaranteed that the sum of $$$N$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.
For each test case, print $$$N$$$ space-separated integers, where the $$$i$$$-th integer is the answer for a starting journey from node $$$i$$$.
23 121 22 33 111 21 3
3 2 32 3 3
Test Case 1:
| Name |
|---|


