280. Trade centers
Time limit per test: 0.5
second(s)
Memory limit: 65536
kilobytes
input: standard
output: standard
The
country has
N cities connected by
N1 bidirectional roads; one can travel from any city to any other by the roads. One of the biggest trade networks
is going to build in some cities trade centers selling the main national product. Because building each trade center costs the company a lot of money, they want to build as few of them as possible. Because
is the biggest producer of the main national product, a citizen living in each city must be able to reach some supermarket using at most
K roads.
Your task is to determine where to build the trade centers.
Input
The first line of the input contains two integers
N and
K (1≤
N≤ 30000, 1≤
K≤ 100). Each of the next
N1 lines contains two integers, denoting the numbers of the cities connected by a road. The cities are numbered starting from 1.
Output
Output the number of the trade centers followed by the numbers of the cities where the trade centers should be built.
Example(s)
sample input

sample output

4 1
1 2
2 3
4 2

1
2

Novosibirsk SU Contest #2, by Novosibirsk Team #1