#P1297E. Modernization of Treeland

    ID: 3625 Type: RemoteJudge 5000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>*special problemdfs and similartrees

Modernization of Treeland

Description

Treeland consists of nn cities and n1n-1 two-way roads connecting pairs of cities. From every city, you can reach every other city moving only by the roads. You are right, the system of cities and roads in this country forms an undirected tree.

The government has announced a program for the modernization of urban infrastructure of some cities. You have been assigned to select an arbitrary subset of cities SS to upgrade (potentially all the cities) that satisfies the following requirements:

  • the subset of cities must be "connected", that is, from any city of the subset SS you can get to any other city of the subset SS by roads, moving only through cities from SS,
  • the number of "dead-ends" in SS must be equal to the given number kk. A city is a "dead-end" if it is the only city in SS or connected to exactly one another city from SS.
This shows one of the possible ways to select SS (blue vertices) for a given configuration and k=4k=4. Dead-ends are vertices with numbers 11, 44, 66 and 77.

Help Treeland upgrade its cities. Find any of the possible subsets SS or determine that such a subset does not exist.

The first line contains an integer tt (1t1041 \le t \le 10^4) — the number of test cases in the input. This is followed by the test cases themselves.

Each test case begins with a line that contains two integers nn and kk (2n31052 \le n \le 3 \cdot 10^5, 1kn1 \le k \le n) — the number of cities in Treeland and the number of "dead-end" cities required in the subset SS.

This is followed by n1n-1 lines with road descriptions. Each road is given by two integers xx and yy (1x,yn1 \le x, y \le n; xyx \ne y) — the numbers of the cities that are connected by this road. It is guaranteed that from every city you can reach any other, moving only by the roads.

The sum of the values of nn for all test cases in the input does not exceed 31053 \cdot 10^5.

For each test case print Yes or No (in any case, upper or lower), depending on whether the answer exists or not. If the answer exists, then print an integer mm (1mn1 \le m \le n) — the number of cities in the found subset. Then print mm different numbers from 11 to nn — the numbers of the cities in the found subset. City numbers can be printed in any order. If there are several answers, print any of them.

Input

The first line contains an integer tt (1t1041 \le t \le 10^4) — the number of test cases in the input. This is followed by the test cases themselves.

Each test case begins with a line that contains two integers nn and kk (2n31052 \le n \le 3 \cdot 10^5, 1kn1 \le k \le n) — the number of cities in Treeland and the number of "dead-end" cities required in the subset SS.

This is followed by n1n-1 lines with road descriptions. Each road is given by two integers xx and yy (1x,yn1 \le x, y \le n; xyx \ne y) — the numbers of the cities that are connected by this road. It is guaranteed that from every city you can reach any other, moving only by the roads.

The sum of the values of nn for all test cases in the input does not exceed 31053 \cdot 10^5.

Output

For each test case print Yes or No (in any case, upper or lower), depending on whether the answer exists or not. If the answer exists, then print an integer mm (1mn1 \le m \le n) — the number of cities in the found subset. Then print mm different numbers from 11 to nn — the numbers of the cities in the found subset. City numbers can be printed in any order. If there are several answers, print any of them.

Sample Input 1

4
10 4
4 5
5 2
2 1
1 3
1 9
9 10
2 7
7 8
5 6
4 3
1 2
2 3
3 4
5 3
1 2
1 3
1 4
1 5
4 1
1 2
2 4
2 3

Sample Output 1

Yes
9
1 2 4 5 6 7 8 9 10 
No
Yes
4
1 3 4 5 
Yes
1
4