280. Trade centers
Time limit per test: 0.5
Memory limit: 65536
country has N
cities connected by N
-1 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
Your task is to determine where to build the trade centers.
The first line of the input contains two integers N
≤ 30000, 1≤ K
≤ 100). Each of the next N
-1 lines contains two integers, denoting the numbers of the cities connected by a road. The cities are numbered starting from 1.
Output the number of the trade centers followed by the numbers of the cities where the trade centers should be built.
Novosibirsk SU Contest #2, by Novosibirsk Team #1