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

18689번 - Baklawa 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB62232237.288%

문제

Baklawa or baklava, is a sweet middle eastern dessert, mainly made from phyllo dough sheets, walnuts, and sugar syrup cut into small cubic pieces and served in cuboid boxes containing multiple layers.

Alice and Bob love to play what they call the last Baklawa game, The rules are as follows:

  • They choose a cuboid containing X by Y by Z cells of Baklawa to play with.
  • There are N poisonous cells both players know them.
  • Alice plays first, and the two players alternate.
  • In his/her turn the player has to cut the cuboid into two cuboids at least one of which is safe (doesn’t contain a poisonous cube) and eats the safe part. The game continues with the other part.
  • A cut is made by slicing along one of the axis X, Y or Z.
  • The person who cannot make a move in his/her turn losses the game.

Assuming both players play optimally, you are asked the following question: who wins the game?

입력

Your program will be tested on one or more test cases. The first line of the input will be a single integer T, the number of test cases (1 ≤ T ≤ 100).

Each test case starts with a line containing four space separated integers:

  • X: The length of the cuboid (1 ≤ X ≤ 1, 000, 000, 000)
  • Y : The width of the cuboid (1 ≤ Y ≤ 1, 000, 000, 000)
  • Z: The height of the cuboid (1 ≤ Z ≤ 1, 000, 000, 000)
  • N: The number of poisonous cells. (0 ≤ N ≤ 100)

Followed by N lines each containing three space separated integers:

  • xi: The x-coordinate of the i-th cube. (1 ≤ xi ≤ X)
  • yi: The y-coordinate of the i-th cube. (1 ≤ yi ≤ Y )
  • zi: The z-coordinate of the i-th cube. (1 ≤ zi ≤ Z)

출력

For each test case, print a single line containing ‘Alice’ if Alice wins the game, or ‘Bob’ otherwise.

제한

예제 입력 1

2
3 3 3 4
3 2 1
3 1 1
3 3 1
3 2 2
5 5 5 1
3 4 2

예제 출력 1

Alice
Bob

힌트

The figure below is an example of the first test case:

출처

ICPC > Regionals > Africa and Arab > Arab Collegiate Programming Contest > 2016 Arab Collegiate Programming Contest I번

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

출처

대학교 대회

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

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