In the game that Xiaoqiang plays, there is a skill tree system.
The skill tree is a tree with node $$$1$$$ as the root node, where each node on the tree represents a skill. Xiaoqiang can use gold coins to light up skills on the skill tree to gain combat power. The prerequisite for lighting up a skill is that the skill's parent node must be lit up. In particular, the root node can be lit up directly.
Each skill has a combat power value, and the combat power gained by Xiaoqiang for lighting up a skill is calculated as follows:
At the same time, Xiaoqiang needs one gold coin to light up a skill, and skills cannot be lit up more than once. Xiaoqiang does not have to use all $$$m$$$ gold coins.
Xiaoqiang currently has $$$m$$$ gold coins, and he hopes to maximize his combat power with these $$$m$$$ coins.
First, input a line with two integers $$$n, m(1 \le n \le 2 \times 10^4, 1 \le m \le 2 \times 10^3)$$$, representing the number of skills on the skill tree and the number of gold coins Xiaoqiang has.
Next, input a line with $$$n$$$ integers, $$$v_1, v_2, \dots, v_n(0 \le v_i \le 1\times 10^9)$$$, where $$$v_i$$$ represents the combat power value of the skill with index $$$i$$$.
Then, input $$$n - 1$$$ lines, each containing two integers $$$u, v(1 \le u, v \le n)$$$, indicating that there is an edge between the skill with index $$$u$$$ and the skill with index $$$v$$$.
Output a single integer, representing the maximum combat power that Xiaoqiang can obtain.
5 31 2 3 4 51 21 32 42 5
6
5 51 2 3 4 51 22 33 44 5
11
5 31 2 3 4 51 22 33 44 5
5
In the first sample, Xiaoqiang can choose to light up the skills with indices $$$1$$$, $$$2$$$, and $$$3$$$.
In the second sample, Xiaoqiang can obtain all skills. After lighting up the skill with index $$$1$$$, he can gain $$$1$$$ unit of combat power; after lighting up the skills with indices $$$2$$$ and $$$3$$$, he can gain $$$2$$$ units of combat power; after lighting up the skills with indices $$$4$$$ and $$$5$$$, he can gain $$$3$$$ units of combat power.
| Name |
|---|


