#P7753. [COCI 2013/2014 #2] LINIJE
[COCI 2013/2014 #2] LINIJE
Description
At the start of the game, they draw points on a coordinate plane.
The players take turns making moves, with Mirko moving first. He draws a line that is parallel to one of the coordinate axes, and it must pass through one of the points.
On the -th move, the player draws a line that is parallel to one of the coordinate axes, and it must pass through one of the points that lies on .
You are not allowed to draw two identical (overlapping) lines.
The loser is the player who cannot make a move.
Given the coordinates of these points, determine who has a winning strategy.
Input Format
The first line contains an integer , the number of points.
The next lines each contain two integers , the coordinates of the point.
Output Format
Output a single line with a string: the name of the player who has a winning strategy, or .
3
1 1
1 2
1 3
Mirko
4
1 1
1 2
2 1
2 2
Slavko
Hint
Explanation for Sample 1
- If Mirko draws the line passing through the point , Slavko must draw the line passing through . This line also passes through .
- Then Mirko draws the line passing through . Slavko’s only remaining move is to draw again, which is not allowed.
- Mirko wins.
Constraints
For easier grading, this problem uses a special scoring method.
There are test cases in total.
- Among them, test cases satisfy .
- The other test cases have no special restrictions.
- Each of the first test cases is worth points.
- Each of the last test cases is worth points.
For of the data, , .
Source
This problem is translated from COCI2013-2014 CONTEST 2 T6 LINIJE.
According to the original problem’s testdata configuration, the full score of this problem is points.
Translated by ChatGPT 5
京公网安备 11011102002149号