프로그램 명: hsin_kosta
제한시간: 5 초
Grill master Kosta followed his entrepreneurial gut and opened N restaurants in Manhattan marked with numbers from 1 to N, respectively. It is well known that the streets of Manhattan are parallel to coordinate axes, which means that we can describe the locations of restaurants with points in a coordinate system, using integer coordinates. More specifically, restaurant A is located on point (XA, YA). The distance between restaurants A and B is the sum of absolute differences of their coordinates: |XA - XB|+|YA - YB|.

Kosta is planning on buying two at most modern machines for automatic making of burgers. Each machine is going to be implemented in an existing restaurant and the burgers will be delivered by car every morning to all the remaining restaurants. Of course, when the burgers are delivered to the remaining restaurants, they are delivered from the closest restaurant that owns a burger machine. For restaurant C, we define DC as the distance between restaurant C to its closest restaurant that owns a burger machine. It’s bad to keep the burgers in the car for too long, so Kosta wants to pick the locations for the burger machines in a way that the furthest restaurant gets the freshest burgers as soon as possible. In other words, we want the maximum value DC to be the minimum possible.

Write a programme that will, based on the locations of restaurants and the number of machines that Kosta is going to buy (one or two), calculate the minimum possible value D so that we can implement the burger machines in existing restaurants, and that the distance to all the remaining restaurants is at most D. Additionally, your programme should determine the optimal locations of the machines. If Kosta is buying two machines, it is allowed to implement both machines in the same restaurant.

입력

출력

Please note: the solution doesn't need to be unique.

입출력 예


입력

2
5
1 1
2 3
5 10
4 6
7 12

출력

5
1 3

입력

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

출력

5
1 3

입력

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

출력

10
3
출처:CROATIAN HIGH SCHOOL COMPETITION

[질/답] [제출 현황] [푼 후(0)]
[ 채 점 ] [홈으로]  [뒤 로]