#P7467. [CERC2018] Game of Stones
[CERC2018] Game of Stones
Description
Translated from [CERC2018] Game of Stones.
Petyr and Varys are playing a game. In the game, the players take turns removing some stones from piles. On his turn, Petyr may remove at most stones from any one pile, and Varys may remove at most stones from any one pile. In each turn, a player must remove at least one stone. The player who takes the last stone wins.
The game has already started, and now it is Petyr's turn to take stones. Your task is to determine whether Petyr can win if both players use optimal strategies.
Input Format
The first line of input contains three integers , meaning there are piles of stones and the two players' limits.
The second line contains numbers , representing the current number of stones in each pile.
Output Format
Output the winner's name.
2 3 4
2 3
Petyr
7 8 9
1 2 3 4 5 6 7
Varys
Hint
Constraints: , .
Translated by ChatGPT 5
京公网安备 11011102002149号