#P1488. 肥猫的游戏
肥猫的游戏
Description
JMcat and PZ are classmates, and both are math whizzes, so it is no surprise that they often discuss math problems together.
One day, JMcat found an interesting geometric game and showed it to PZ. The game is played on a convex polygon with vertices. Its diagonals divide the polygon into triangles, and these diagonals intersect at the polygon’s vertices. One of the triangles is colored black, and the others are white.
The two players take turns. On your turn, you must cut off one triangle from the polygon along the drawn diagonals. The player who cuts off the black triangle wins. Assume JMcat moves first. Does JMcat have a winning strategy? Please write a program to help JMcat find out.
Input Format
The first line contains an integer , the number of vertices of the polygon. The vertices are labeled from to in clockwise order.
Each of the next lines describes one of the triangles forming the polygon. Line contains three space-separated nonnegative integers , , and , which are the vertex labels of the -th triangle. The first triangle given is black.
Output Format
Output a single line. If JMcat has a winning strategy, print JMcat Win; otherwise, print PZ Win (note the case and the space).
6
0 1 2
2 4 3
4 2 0
0 5 4
JMcat Win
Hint
Constraints: .
A polygon is called convex if every line segment connecting any two points of the polygon lies entirely within the polygon.
Translated by ChatGPT 5
京公网安备 11011102002149号