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

16705번 - Game of Stones 다국어

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

문제

Two players, Petyr and Varys, play a game in which players remove stones from N piles in alternating turns. Petyr, in his turn, can remove at most A stones from any pile. Varys, in his turn, can remove at most B stones from any pile. Each player has to remove at least one stone in his turn. The player who removes the last stone wins.

The game has already started and it is Petyr’s turn now. Your task is to determine whether he can win the game if both he and Varys play the game in the best possible way.

입력

The first input line contains three integers N, A, and B (1 ≤ N ≤ 105 and 1 ≤ A, B ≤ 105). N describes the number of piles and A, B represent Petyr’s and Varys’ restrictions. The second line contains N integers X1, . . . , XN (1 ≤ Xi ≤ 106) specifying the current number of stones in all piles.

출력

Output the name of the winner.

제한

예제 입력 1

2 3 4
2 3

예제 출력 1

Petyr

예제 입력 2

7 8 9
1 2 3 4 5 6 7

예제 출력 2

Varys

힌트

출처

ICPC > Regionals > Europe > Central European Regional Contest > CERC 2018 S번

  • 데이터를 추가한 사람: queued_q
(追記) (追記ここまで)

출처

대학교 대회

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

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