Problem Statement
At the end of last year, Santa Claus forgot to give Christmas presents to the children of JOI Village. Therefore, as an apology, he decided to deliver chocolate cakes to the children. Since the delivery day is tomorrow, he must soon come up with a movement plan.
JOI Village is divided into a grid by $W$ straight north-south roads and $H$ straight east-west roads. The $W$ north-south roads are numbered $1, 2, \dots, W$ in order from the west, and the $H$ east-west roads are numbered $1, 2, \dots, H$ in order from the south. The intersection where the $x$-th north-south road from the west and the $y$-th east-west road from the south meet is denoted by $(x, y)$. There are $N$ houses in JOI Village, and each of them is located at some intersection. Santa Claus can only move along the roads. The time required to move between adjacent intersections is $1$.
Since there are children in every house in JOI Village, Santa Claus must visit every house in JOI Village to deliver $1$ chocolate cake to each house. Because flying around the sky with reindeer while holding precious chocolate cakes is somewhat dangerous, Santa Claus and the reindeer will land at one of the intersections in JOI Village, and Santa Claus will walk from there to deliver the chocolate cakes. Santa Claus will not walk while carrying $2$ or more chocolate cakes at the same time. That is, every time Santa Claus delivers a chocolate cake to $1$ house, he returns to the intersection where he landed.
Santa Claus has decided to choose a movement plan that minimizes the total time required from when he lands in JOI Village until he delivers chocolate cakes to all the houses. Note that the time required to return to the landing intersection after delivering the chocolate cake to the last house is not included in the required time. Also, nothing other than the time taken for movement is considered.
Given the information on the locations of the houses, write a program to find the minimum total time required from landing in JOI Village until delivering chocolate cakes to all the houses when Santa Claus chooses the landing intersection optimally, as well as the location of the intersection where he should land to minimize the required time.
Input
Read the following input from Standard Input:
- The $1$-st line contains the integers $W, H$ separated by a space, representing the number of roads in each direction.
- The $2$-nd line contains an integer $N$, representing the number of houses.
- The following $N$ lines contain the information on the locations of the houses. The $(i + 2)$-th line ($1 \le i \le N$) contains the integers $X_i, Y_i$ separated by a space, representing that the $i$-th house is located at the intersection $(X_i, Y_i)$. These $N$ intersections are all distinct.
Output
Output the following data to Standard Output:
- The $1$-st line must contain $1$ integer representing the minimum required time.
- The $2$-nd line must contain the $2$ integers $x, y$ separated by a space in this order, when the intersection where Santa Claus should land to minimize the required time is $(x, y)$. If there are multiple suitable intersections, choose the westernmost one (that is, the one with the smallest value of $x$) among them; if it is still not uniquely determined as $1$ intersection, choose the southernmost one (that is, the one with the smallest value of $y$) among those.
Sample
Sample 1
Input
5 4 3 1 1 3 4 5 3
Output
10 3 3
Explanation
For example, the required time can be minimized by the following movement plan:
- Land at intersection $(3, 3)$.
- Deliver a chocolate cake to the house located at intersection $(3, 4)$. The elapsed time up to this point is $1$.
- Return to intersection $(3, 3)$. The elapsed time up to this point is $2$.
- Deliver a chocolate cake to the house located at intersection $(5, 3)$. The elapsed time up to this point is $4$.
- Return to intersection $(3, 3)$. The elapsed time up to this point is $6$.
- Deliver a chocolate cake to the house located at intersection $(1, 1)$. The elapsed time up to this point is $10$.
Sample 2
Input
4 6 8 1 3 3 2 4 4 2 5 2 3 3 3 3 4 2 4
Output
21 2 3
Explanation
Note that Santa Claus may land at an intersection where a house is located.
Constraints
- $1 \le W \le 1000000000 = 10^9$: the number of north-south roads.
- $1 \le H \le 1000000000 = 10^9$: the number of east-west roads.
- $1 \le N \le 100000 = 10^5$: the number of houses.
- $1 \le X_i \le W$: the road number of the north-south road for the location of the $i$-th house.
- $1 \le Y_i \le H$: the road number of the east-west road for the location of the $i$-th house.
Note that in this problem, the range of integers handled may not fit in $32$ bits.
Scoring
- For test cases worth $40\%$ of the total score, $N \le 1000$ holds.
- For test cases worth $10\%$ of the total score, $W \le 50, H \le 50, N \le 1000$ hold.