{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"A closed polygon is a figure bounded by a finite number of line segments. The intersections of the bounding line segments are called the vertices of the polygon. When one starts at any vertex of a closed polygon and traverses each bounding line segment exactly once, one comes back to the starting vertex. \r\u003cbr\u003e\r\u003cbr\u003eA closed polygon is called convex if the line segment joining any two points of the polygon lies in the polygon. Figure 1 shows a closed polygon which is convex and one which is not convex. (Informally, a closed polygon is convex if its border doesn\u0027t have any \"dents\".) \r\u003cbr\u003e\u003ccenter\u003e\u003cimg src\u003d\"CDN_BASE_URL/b83b5b5af56390bc9cf8c35b4bd6b071?v\u003d1715714757\"\u003e\u003c/center\u003e\r\u003cbr\u003eThe subject of this problem is a closed convex polygon in the coordinate plane, one of whose vertices is the origin (x \u003d 0, y \u003d 0). Figure 2 shows an example. Such a polygon will have two properties significant for this problem. \r\u003cbr\u003e\r\u003cbr\u003eThe first property is that the vertices of the polygon will be confined to three or fewer of the four quadrants of the coordinate plane. In the example shown in Figure 2, none of the vertices are in the second quadrant (where x \u0026lt; 0, y \u0026gt; 0). \r\u003cbr\u003e\r\u003cbr\u003eTo describe the second property, suppose you \"take a trip\" around the polygon: start at (0, 0), visit all other vertices exactly once, and arrive at (0, 0). As you visit each vertex (other than (0, 0)), draw the diagonal that connects the current vertex with (0, 0), and calculate the slope of this diagonal. Then, within each quadrant, the slopes of these diagonals will form a decreasing or increasing sequence of numbers, i.e., they will be sorted. Figure 3 illustrates this point. \r\u003cbr\u003e\u003ccenter\u003e\u003cimg src\u003d\"CDN_BASE_URL/06f841ab69ac44b5e47d4909e85ebbf8?v\u003d1715714757\"\u003e\r\u003cbr\u003e\u003cimg src\u003d\"CDN_BASE_URL/44afcd1357e8a0c292c8f09fd15b203f?v\u003d1715714757\"\u003e\u003c/center\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The input lists the vertices of a closed convex polygon in the plane. The number of lines in the input will be at least three but no more than 50. Each line contains the x and y coordinates of one vertex. Each x and y coordinate is an integer in the range -999..999. The vertex on the first line of the input file will be the origin, i.e., x \u003d 0 and y \u003d 0. Otherwise, the vertices may be in a scrambled order. Except for the origin, no vertex will be on the x-axis or the y-axis. No three vertices are colinear. "}},{"title":"Output","value":{"format":"HTML","content":"The output lists the vertices of the given polygon, one vertex per line. Each vertex from the input appears exactly once in the output. The origin (0,0) is the vertex on the first line of the output. The order of vertices in the output will determine a trip taken along the polygon\u0027s border, in the counterclockwise direction. The output format for each vertex is (x,y) as shown below. "}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e0 0\r\n70 -50\r\n60 30\r\n-30 -50\r\n80 20\r\n50 -60\r\n90 -20\r\n-30 -40\r\n-10 -60\r\n90 10\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e(0,0)\r\n(-30,-40)\r\n(-30,-50)\r\n(-10,-60)\r\n(50,-60)\r\n(70,-50)\r\n(90,-20)\r\n(90,10)\r\n(80,20)\r\n(60,30)\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}