P7753 [COCI 2013/2014 #2] LINIJE
Background
Mirko and his loyal friend Slavko were really bored one day, so they created a new game.
Description
At the start of the game, they draw $N$ points on a coordinate plane.
The players take turns making moves, with Mirko moving first. He draws a line $l_1$ that is parallel to one of the coordinate axes, and it must pass through one of the $N$ points.
On the $i(i\ge2)$-th move, the player draws a line $l_i$ that is parallel to one of the coordinate axes, and it must pass through one of the $N$ points that lies on $l_{i-1}$.
**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 $N$ points, determine who has a winning strategy.
Input Format
The first line contains an integer $N$, the number of points.
The next $N$ lines each contain two integers $X,Y$, the coordinates of the point.
Output Format
Output a single line with a string: the name of the player who has a winning strategy, $\tt Mirko$ or $\tt Slavko$.
Explanation/Hint
#### Explanation for Sample 1
- If Mirko draws the line $y=1$ passing through the point $(1,1)$, Slavko must draw the line $x=1$ passing through $(1,1)$. This line also passes through $(1,2)$.
- Then Mirko draws the line $y=2$ passing through $(1,2)$. Slavko’s only remaining move is to draw $x=1$ again, which is not allowed.
- Mirko wins.
#### Constraints
**For easier grading, this problem uses a special scoring method.**
There are $40$ test cases in total.
- Among them, $16$ test cases satisfy $1\le N\le 10$.
- The other $24$ test cases have no special restrictions.
- Each of the first $20$ test cases is worth $4$ points.
- Each of the last $20$ test cases is worth $8$ points.
For $100\%$ of the data, $1\le N\le 10^4$, $1\le X,Y\le 500$.
#### Source
**This problem is translated from [COCI2013-2014](https://hsin.hr/coci/archive/2013_2014/) [CONTEST 2](https://hsin.hr/coci/archive/2013_2014/contest2_tasks.pdf) _T6 LINIJE_.**
According to the original problem’s testdata configuration, the full score of this problem is $160$ points.
Translated by ChatGPT 5