{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eThere is a kingdom called Dream Kingdom with $N$ cities connected by $N - 1$ roads. There is a path between any two city. The length of each road is one kilometer. The cities are numbered from $1$ to $N$. There are $M$ X-men in this kingdom. The $i$-th X-man is in the city numbered $a_i(1 \\leq a_i \\leq N)$. There can be no or multiple X-men in one city.\u003cbr\u003e\u003cbr\u003eEveryone start to walk simultaneously. At the beginning of each hour, one man will choose a adjacent city (\"adjacent\" means there is a road between two cities) which is on the shortest path to the city where there is a man he can communicate with now. If there are several eligible adjacent cities that can be chosen, the X-man will choose one of them \\textbf{randomly}. Each x-man will make the decision and move simultaneously. The speed of X-men is only one kilometer per hour. So they will move to chosen city at the end of each hour. X-men can communicate with the people whose distance to him is \\textbf{more than one} kilometer at this time. If there are no X-man he can communicate with now, he will not move in the following hour.\u003cbr\u003e\u003cbr\u003eThe king of the Dream Kingdom want to arrest X-men. And at the beginning of one hour he could check whether there is any X-man can move in the following hour. If the king knows no X-man can move in the following hour, he will send the army to catch all X-men immediately.\u003cbr\u003e\u003cbr\u003eNow the king wants you to help him calculate the expected hours he could arrest the X-men. In other words, you need to calculate the expected hours such that all X-men stop moving.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line is the number of test cases.\u003cbr\u003e\u003cbr\u003eFor each test case, the first line contains two positive numbers $N(1 \\leq N \\leq 10^3), M(1 \\leq M \\leq 10^3)$. The second line contains $M$ numbers $a_i (1 \\leq a_i \\leq N)$.\u003cbr\u003e\u003cbr\u003eThe following $N - 1$ lines describe the roads. Each line contains two integers $u, v$ $(1 \\leq u,v \\leq N)$, denoting there is a road between city $u$ and city $v$."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output one number in one single line representing the answer. You should output your answer rounded to two decimal places."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n7 3\r\n5 6 7\r\n1 2\r\n1 3\r\n1 4\r\n5 2\r\n6 3\r\n4 7\r\n3 3\r\n1 1 2\r\n1 2\r\n2 3\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2.00\r\n0.00\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cbr\u003eIn the first example, each X-man only have one adjacent city can be chosen to move in the first hour. They will move from city {5, 6, 7} to city {2, 3, 4} respectively. Each X-man only have one adjacent city can be chosen to move in the second hour, too. They will all move to city {1}. And then all of them can\u0027t feel any X-man such that distance between two X-men is more than one unit length. So they will be arrested immediately after two hours from the beginning to now. This is the only situation. So the answer is {2/1 \u003d 2.00}.\u003cbr\u003e"}}]}