302754: CF533C. Board Game
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Board Game
题意翻译
$\texttt{Polycarp}$ 和 $\texttt{Vasiliy}$ 各有一个棋子,它们分别在 $(x_p,y_p)$ 和 $(x_v,y_v)$。每人只能移动自己的棋子。 若棋子在 $(x,y)$,一次移动可以将其移动到 $(x-1,y)$ 或者 $(x,y-1)$,并且不能移动到不合法位置。 如果 $(x,y)$ 满足以下任一条,那么它是不合法的: + $x<0$。 + $y<0$。 + 别人的棋子在 $(x,y)$。 每次操作可以在以下事情中任选一件做: + 移动一次棋子 + 什么都不做 $\texttt{Polycarp}$ 先手,两人轮流操作。 将棋子移动到 $(0,0)$ 的人获得胜利。 现在假设 $\texttt{Polycarp}$ 和 $\texttt{Vasiliy}$ 都足够聪明,问谁能胜利。 $0\le x_p,y_p,x_v,y_v\le 10^5$,保证最开始时两个棋子不在同一位置并且没有棋子在 $(0,0)$。题目描述
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 $ (x,y) $ to $ (x-1,y) $ or $ (x,y-1) $ . Vasiliy can move his pawn from $ (x,y) $ to one of cells: $ (x-1,y),(x-1,y-1) $ and $ (x,y-1) $ . 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 $ x $ -coordinate or $ y $ -coordinate or to the cell containing opponent's pawn The winner is the first person to reach cell $ (0,0) $ . 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: $ x_{p},y_{p},x_{v},y_{v} $ ( $ 0<=x_{p},y_{p},x_{v},y_{v}<=10^{5}) $ — 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 $ (0,0) $ .
输出格式
Output the name of the winner: "Polycarp" or "Vasiliy".
输入输出样例
输入样例 #1
2 1 2 2
输出样例 #1
Polycarp
输入样例 #2
4 7 7 4
输出样例 #2
Vasiliy