#P5086. 坐标
坐标
Description
There are coordinates. For the -th coordinate with parameters and the -th coordinate with parameters , if $X _ i - X _ j = Y _ i - Y _ j = Z _ i - Z _ j = Q _ i - Q _ j$, then these coordinates are called beautiful coordinates.
Given coordinates, Xiaoben wants to know the minimum value of and the maximum value of among all beautiful coordinate pairs. Can you help him?
Input Format
The input has lines. The first line contains an integer . Then follow lines, each containing four integers , , , and .
Output Format
Output one line containing the minimum value of and the maximum value of , separated by a space. The testdata guarantees that a solution exists.
7
1 2 3 4
2 3 4 5
1 4 3 3
5 2 3 5
2 4 5 6
1 4 3 3
2 5 4 4
1 13
10
1 4 3 2
4 4 4 4
2 3 4 5
1 1 1 1
1 2 3 1
3 4 2 1
2 4 5 2
8 9 7 6
0 0 0 0
1 2 3 4
2 14
Hint
Explanation for Sample 1
and , or and , achieve the minimum value.
For and , is the maximum value.
Constraints
For of the data, .
For of the data, , and , , , are all within the int range.
Translated by ChatGPT 5
京公网安备 11011102002149号