cswork / OAOpen practice workspace

UpstartOA #1

Bounding Box from Coordinates

Estimated EasyJudge-ready

Topics (AI-labelled)In-place Arrays

すべての2次元の点を覆う、軸に平行な最小の長方形を求め、その左下隅の座標、幅、高さを出力してください。

入力

n(1≤n≤200000)が与えられ、続く n 行に整数 x y(−10^9≤x,y≤10^9)が与えられます。

出力

minX minY width height をスペース区切りで出力します。

例 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

Editorial

Loading solution…