cswork / OA打开练习工作台

UpstartOA #1

Bounding Box from Coordinates

估计简单可在线判题

考点(AI 标注)原地数组

Find the smallest axis-aligned rectangle that covers all 2D points, and output its bottom-left corner coordinates, width, and height.

The standard input/output format and any supplementary ranges on this site are as stated in this problem.

输入格式

n (1≤n≤200000), followed by n lines of integers x y (−10^9≤x,y≤10^9).

输出格式

Output minX minY width height, separated by spaces.

样例 1

输入:

3
2 3
5 7
1 4

输出:

1 3 4 4

样例 2

输入:

1
0 0

输出:

0 0 0 0

样例 3

输入:

9
-9 -20
-5 0
7 -7
11 -19
6 -6
19 13
14 19
5 -7
9 -18

输出:

-9 -20 28 39