k connected cities (the area of the capital is a connected component with exactly. k cities). To show the importance of the capital, the King wants to minimize the maximum value of all the. We define the value of a city as the minimum distance between the city and one city which belongs to the capital. The distance between two cities is the length of the shortest path between them.
There is a kingdom that has n n cities connected by n-1 n−1 roads. All roads' length is 1 1. The King wants to choose an area to be the capital of the kingdom. The area must have exactly k k connected cities (the area of the capital is a connected component with exactly k k cities). To show the importance of the capital, the King wants to minimize the maximum value of all the n n cities. We define the value of a city as the minimum distance between the city and one city which belongs to the capital. The distance between two cities is the length of the shortest path between them.