#P4756. Board Game
Board Game
Board Game
题面翻译
和 各有一个棋子,它们分别在 和 。每人只能移动自己的棋子。
若 的棋子在 ,则 一次移动可以将其移动到 或者 ;若 的棋子在 ,则 一次移动可以将其移动到 或 。二人都不能移动到不合法位置。
如果 满足以下任一条,那么它是不合法的:
-
。
-
。
-
别人的棋子在 。
每次操作可以在以下事情中任选一件做:
-
移动一次棋子
-
什么都不做
先手,两人轮流操作。
将棋子移动到 的人获得胜利。
现在假设 和 都足够聪明,问谁能胜利。
,保证最开始时两个棋子不在同一位置并且没有棋子在 。
题目描述
Polycarp and Vasiliy love simple logical games. Today they play a game with infinite chessboard and one pawn for each player. Polycarp and Vasiliy move in turns, Polycarp starts. In each turn Polycarp can move his pawn from cell to or . Vasiliy can move his pawn from to one of cells: and . Both players are also allowed to skip move.
There are some additional restrictions — a player is forbidden to move his pawn to a cell with negative -coordinate or -coordinate or to the cell containing opponent's pawn The winner is the first person to reach cell .
You are given the starting coordinates of both pawns. Determine who will win if both of them play optimally well.
输入格式
The first line contains four integers: ( — Polycarp's and Vasiliy's starting coordinates.
It is guaranteed that in the beginning the pawns are in different cells and none of them is in the cell .
输出格式
Output the name of the winner: "Polycarp" or "Vasiliy".
样例 #1
样例输入 #1
2 1 2 2
样例输出 #1
Polycarp
样例 #2
样例输入 #2
4 7 7 4
样例输出 #2
Vasiliy
提示
In the first sample test Polycarp starts in and will move to in the first turn. No matter what his opponent is doing, in the second turn Polycarp can move to and finally to in the third turn.