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

27597번 - Spinach Pizza 다국어인터랙티브

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB51302958.000%

문제

The two siblings Alberto and Beatrice have to eat a spinach pizza together. However, none of them likes spinach, so they both want to eat as little as possible.

The pizza has the shape of a strictly convex polygon with $n$ vertices located at integer coordinates $(x_1, y_1), (x_2, y_2), \dots , (x_n, y_n)$ of the plane.

The siblings have decided to eat the pizza in the following way: taking turns, starting with Alberto, each sibling chooses a vertex of the remaining part of the pizza and eats out the triangle determined by its two neighboring edges. In this way, after each of the first $n - 3$ turns the pizza will have one less vertex. The game ends after the $(n - 2)$-th turn, when all the pizza has been eaten.

Assuming that Alberto and Beatrice choose the slices to eat optimally, which of the siblings manages to eat at most half of the pizza? You should identify a sibling that has a strategy to do so and help them choose the slices appropriately. Note that it is possible that both Alberto and Beatrice end up eating exactly half of the area if they choose their slices optimally.

입력

The first line contains a single integer $n$ (4ドル ≤ n ≤ 100$) — the number of vertices.

The next $n$ lines contain two integers $x_i$ and $y_i$ each ($-10^6 ≤ x_i , y_i ≤ 10^6$) — the coordinates of the $i$-th vertex of the polygon representing the initial shape of the pizza.

It is guaranteed that the polygon is strictly convex and that its vertices are given in counterclockwise order.

출력

제한

인터랙션

First, you should print a line containing either the string Alberto or the string Beatrice — the sibling that you will help to win.

Then, for the next $n-2$ turns, you will alternate with the judge in choosing a slice of the pizza and removing it, starting with you if you chose to help Alberto, or starting with the judge if you chose to help Beatrice.

  • When it is your turn, print a single line containing an integer $p$ (1ドル ≤ p ≤ n$) that has not been chosen before, indicating that you want to eat the slice determined by the vertex located at $(x_p, y_p)$.
  • When it is the judge’s turn, read an integer $q$ (1ドル ≤ q ≤ n$), indicating that the other player eats the slice determined by the vertex located at $(x_q, y_q)$. It is guaranteed that $q$ has not been chosen before.

If one of your interactions is malformed, the interactor terminates immediately and your program receives the verdict WRONG-ANSWER. Otherwise, you will receive CORRECT if at the end your player has eaten at most half of the pizza, and WRONG-ANSWER otherwise.

After printing a line do not forget to end the line and flush the output. Otherwise, you will get the verdict TIMELIMIT. To flush the output, use:

  • fflush(stdout) in C;
  • fflush(stdout), cout << flush or cout.flush() in C++;
  • System.out.flush() in Java and Kotlin;
  • sys.stdout.flush() in Python.

예제 입력 1

4
0 0
6 1
5 3
1 4

예제 출력 1

The pizza has area 15ドル$. Alberto can eat less than half of the pizza by eating the slice around vertex 2ドル$ (which has area 6ドル.5$) or around vertex 3ドル$ (which has area 3ドル.5$).

예제 입력 2

6
0 0
2 0
3 2
2 4
0 4
-1 2

예제 출력 2

It can be proved that both players will eat exactly half of the pizza if they eat optimally. Therefore it is possible to choose to help either Alberto or Beatrice.

예제 입력 3

7
0 0
2 0
5 2
4 5
1 5
-1 4
-1 2

예제 출력 3

It is possible to show that only Beatrice has a strategy to eat at most half of the pizza. The following is an example of a valid interaction (after reading the input):

Contestant Judge Explanation
Beatrice The contestant will help Beatrice
7 Alberto eats the triangle with vertices 6ドル,ドル 7ドル,ドル 1ドル$ and area 1ドル$
2 Beatrice eats the triangle with vertices 1ドル,ドル 2ドル,ドル 3ドル$ and area 2ドル$
5 Alberto eats the triangle with vertices 4ドル,ドル 5ドル,ドル 6ドル$ and area 1ドル.5$
4 Beatrice eats the triangle with vertices 3ドル,ドル 4ドル,ドル 6ドル$ and area 8ドル$
6 Alberto eats the triangle with vertices 3ドル,ドル 6ドル,ドル 1ドル$ and area 11ドル$

The total area eaten by Alberto is 13ドル.5$ and the total area eaten by Beatrice is 10ドル,ドル which is less than half the area of the whole pizza. The actions performed by the contestant and the judge in this example of interaction may be non-optimal. The process is illustrated below:

힌트

출처

ICPC > Regionals > Europe > Southwestern European Regional Contest > SWERC 2022-2023 E번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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