A wealthy country owes much of its riches to its own gold deposits. To raise output, the government has decided to permanently assign miners to specific tunnels.
Every mine in the country has the same structure. A mine has exactly one entrance and consists of chambers joined by tunnels. From the entrance there is exactly one route to each chamber (possibly passing through several tunnels and other chambers along the way), so a mine forms a tree.
Gold is extracted only in chambers that connect to exactly one other chamber. The entrance chamber, however, is never used for extraction, even when it connects to only one other chamber.
Tunnels have different heights. A miner loaded with equipment cannot stoop, so a miner can pass through a tunnel only if its height is at least the miner's own height. Hence a miner can reach a chamber only if every tunnel on the route from the entrance to that chamber is at least as tall as the miner.
Given the layout of chambers and tunnels together with the height of each miner, write a program that reports the largest number of miners who can extract gold at the same time. Each chamber can hold at most one miner.
The first line contains a single integer T (1≤T≤5), the number of datasets. The datasets follow.
The first line of each dataset contains two integers n and k (3≤n≤200000, 1≤k≤n): the number of chambers (numbered from 1 to n) and the number of the entrance chamber.
The next n−1 lines describe the tunnels. Each line contains three integers a, b, c (1≤a<b≤n, 1≤c≤1000), meaning that chambers a and b are joined by a tunnel of height c. No pair of chambers appears more than once.
The next line contains a single integer m (1≤m≤200000), the number of miners assigned to this mine. The following line contains m positive integers, each at most 1000, giving the heights of the miners.
Print T lines. Line i contains the answer for the i-th dataset: the largest number of miners who can extract gold at the same time. A miner may pass through a tunnel only if its height is at least the miner's height.