Logo
(追記) (追記ここまで)

7391번 - Find the Border 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 128 MB51133.333%

문제

Closed polyline (with possible self-intersections) partitions a plane into a number of regions. One of the regions is unbounded --- it is an exterior of the polyline. All the bounded regions together with the polyline itself form an interior of the polyline (shaded in the picture below). The border of the interior (bold line in the picture) is a polyline as well. This polyline has the same interior as the original one. Your task is to find the border of the interior of the given polyline.

To guarantee the uniqueness (up to the starting point) of the polyline representing the border we require that the following conditions are satisfied for it:

  • it has no self-intersections, although may have self-touchings;
  • no adjacent vertices of the border coincide;
  • no adjacent edges of the border are collinear;
  • when traversing the border, its interior is always to the left of its edges.

입력

The first line of the input file contains an integer number $n$ (3ドル \le n \le 100$) --- the number of vertices in the original polyline. Following $n$ lines contain two integer numbers $x_i$ and $y_i$ on a line (0ドル \le x_i, y_i \le 100$) --- coordinates of the vertices. All vertices are different and no vertex lies on an edge between two other vertices. Adjacent edges of the polyline are not collinear.

출력

Write to the output file an integer number $m$ --- the number of vertices of the border. Then write $m$ lines with coordinates of the vertices. Coordinates must be precise up to 4 digits after the decimal point.

제한

예제 입력 1

10
4 9
9 9
12 4
10 2
9 5
14 10
14 5
10 9
11 4
4 4

예제 출력 1

13
9.3333 4
10 2
12 4
10.5 6.5
11.5 7.5
14 5
14 10
11.5 7.5
10 9
10.5 6.5
9 9
4 9
4 4

힌트

출처

ICPC > Regionals > Northern Eurasia > Northern Eurasia Finals > NEERC 2004 F번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /