eolymp
bolt
Try our new interface for solving problems
Problems

Garden

Garden

There are \textbf{n} precious trees in the garden (for simplicity's sake, we will treat them as points on a standard Euclidean plane). Build a square fence around the trees such that: \begin{itemize} \item all the trees are inside the square, \item there is at least one tree on every side of the square (a point in the corner counts for both sides). \end{itemize} This way, no one can accuse you of claiming too much land. You do not care for the area of the garden, or the amount of fence needed - any such square will do. Only the trees are important, after all! \InputFile The first line contains the number \textbf{t} of test cases. The test cases follow. First line of a test case contains the number of trees \textbf{n} (\textbf{4} ≤ \textbf{n} ≤ \textbf{100 000}). Then \textbf{n} lines follow - for \textbf{j} = \textbf{1}, \textbf{2}, ..., \textbf{n}, \textbf{j}-th of these lines contains two integer numbers \textbf{x_j}, \textbf{y_j} - coordinates of the \textbf{j}-th tree. The coordinates' absolute values do not exceed \textbf{10^9}. No two trees coincide. \OutputFile For each test case, your program should output four lines, each containing a pair of real numbers - the coordinates of the vertices of the square found by your program. Print the values with \textbf{6} digits after the decimal point.
Time limit 1 second
Memory limit 128 MiB
Input example #1
1
4
0 0
0 2
1 2
1 0
Output example #1
0.500000 2.500000
-1.000000 1.000000
0.500000 -0.500000
2.000000 1.000000
Source 2013 Petrozavodsk Winter Training Camp, Jagiellonian University Contest, January 25, Problem G