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

26203번 - Cutting with Lasers 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB19161583.333%

문제

A laser cutting machine for wood sheets has a laser head that can move in only two directions, horizontal and vertical. You have been hired to be part of the testing team for the machine.

One of the tests consists of programming the machine to perform a non-empty sequence of consecutive cuts that starts and ends at the same point. Each cut in the sequence, except the first, starts at the point at which the previous cut ended. No cuts touch the edge of the sheet to be cut. Figures (a) and (b) below show two examples of cutting sequences, with respectively 8ドル$ and 14ドル$ cuts.

Your boss asked you to determine the area of the largest piece produced by the sequence of cuts, disregarding the piece attached to the edges of the cut sheet. That is, only the pieces contained in the polygon formed by the cut lines should be considered. Figures (c) and (d) below show respectively the largest pieces produced by the cuts of figures (a) and (b).

To illustrate, figures (e) and (f) below show the discarded piece (which contains the edges of the wood sheet) of the cut sequences of figures (a) and (b), respectively.

입력

The first line contains an integer $N,ドル the number of cuts in the sequence (4ドル ≤ N ≤ 10^4$). The second line contains two integers $X_0$ and $Y_0,ドル the initial position of the laser head in the sequence of cuts (1ドル ≤ X_0 ≤ 10^3$ and 1ドル ≤ Y_0 ≤ 10^3$). Each of the next $N$ lines contains two integers $X_i$ and $Y_i$ , the final position of the cut $i$ (1ドル ≤ X_i ≤ 10^3$ and 1ドル ≤ Y_i ≤ 10^3,ドル for 1ドル ≤ i ≤ N,ドル and $(X_N , Y_N ) = (X_0, Y_0)$). All positions given in the input are distinct, except the first and the last positions.

출력

Your program must output a single line, containing a single integer, the area of the largest piece produced by the sequence of cuts.

제한

예제 입력 1

8
2 1
7 1
7 4
3 4
3 2
5 2
5 6
2 6
2 1

예제 출력 1

17

예제 입력 2

14
1 1
8 1
8 6
6 6
6 2
2 2
2 4
7 4
7 5
3 5
3 3
4 3
4 6
1 6
1 1

예제 출력 2

21

힌트

출처

ICPC > Regionals > Latin America > Sub-Regional Brasil do ACM ICPC > Maratona de Programação da SBC 2022 C번

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

출처

대학교 대회

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

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