UpstartOA #1
Bounding Box from Coordinates
Estimated EasyJudge-ready
Topics (AI-labelled)In-place Arrays
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.
Input
n (1≤n≤200000), followed by n lines of integers x y (−10^9≤x,y≤10^9).
Output
Output minX minY width height, separated by spaces.
Example 1
Input:
3
2 3
5 7
1 4
Output:
1 3 4 4
Example 2
Input:
1
0 0
Output:
0 0 0 0
Example 3
Input:
9
-9 -20
-5 0
7 -7
11 -19
6 -6
19 13
14 19
5 -7
9 -18
Output:
-9 -20 28 39
Editorial
Loading solution…