a832: Art
Tags :
Accepted rate : 18人/19人 ( 95% ) [非即時]
評分方式:
Strictly

最近更新 : 2022-10-16 19:08

Content

Mahima has been experimenting with a new style of art. She stands in front of a canvas and, using her brush, flicks drops of paint onto the canvas. When she thinks she has created a masterpiece, she uses her 3D printer to print a frame to surround the canvas.

Your job is to help Mahima by determining the coordinates of the smallest possible rectangular frame such that each drop of paint lies inside the frame. Points on the frame are not considered inside the frame.

Input

The first line of input contains the number of drops of paint, N, where 2  N 100 and N is an integer. Each of the next N lines contain exactly two positive integers X and Y separated by one comma (no spaces). Each of these pairs of integers represents the coordinates of a drop of paint on the canvas. Assume that X <100 and Y <100, and that there will be at least two distinct points. The coordinates (0, 0) represent the bottom-left corner of the canvas.

For 12 of the 15 available marks, X and Y will both be two-digit integers.

Output

Output two lines. Each line must contain exactly two non-negative integers separated by a single comma (no spaces). The first line represents the coordinates of the bottom-left corner of the rectangular frame. The second line represents the coordinates of the top-right corner of the rectangular frame.

Sample Input #1
5
44,62
34,69
24,78
42,44
64,10
Sample Output #1
23,9
65,79
測資資訊:
記憶體限制: 64 MB
公開 測資點#0 (6%): 1.0s , <1K
公開 測資點#1 (6%): 0.625s , <1K
公開 測資點#2 (6%): 0.625s , <1K
公開 測資點#3 (6%): 0.625s , <1K
公開 測資點#4 (6%): 0.625s , <1K
公開 測資點#5 (6%): 0.625s , <1K
公開 測資點#6 (6%): 0.625s , <1K
公開 測資點#7 (6%): 0.625s , <1K
公開 測資點#8 (6%): 0.625s , <1K
公開 測資點#9 (6%): 0.625s , <1K
公開 測資點#10 (6%): 0.625s , <1K
公開 測資點#11 (6%): 0.625s , <1K
公開 測資點#12 (7%): 0.625s , <1K
公開 測資點#13 (7%): 0.625s , <1K
公開 測資點#14 (7%): 0.625s , <1K
公開 測資點#15 (7%): 0.625s , <1K
Hint :
Tags:
出處:
[管理者:
cplei@g.puic... (李振邦Lei Chan Pon...)
]


ID User Problem Subject Hit Post Date
沒有發現任何「解題報告」