There is 1<=n<=1000 cities. I have to find path that connects all the cities (every city can be visited only once) which starts and ends in city number 1. In this path the maximum length between 2 cities must be as short as possible.
Eg:

Input:
coordinates of cities
Output:
5 1 3 //longest connection is 5 and it is between cities 1 and 3
1 3 6 4 5 2 1 //path