#P7753. [COCI 2013/2014 #2] LINIJE

[COCI 2013/2014 #2] LINIJE

Description

At the start of the game, they draw NN points on a coordinate plane.

The players take turns making moves, with Mirko moving first. He draws a line l1l_1 that is parallel to one of the coordinate axes, and it must pass through one of the NN points.

On the i(i2)i(i\ge2)-th move, the player draws a line lil_i that is parallel to one of the coordinate axes, and it must pass through one of the NN points that lies on li1l_{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 NN points, determine who has a winning strategy.

Input Format

The first line contains an integer NN, the number of points.

The next NN lines each contain two integers X,YX,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, Mirko\tt Mirko or Slavko\tt Slavko.

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 y=1y=1 passing through the point (1,1)(1,1), Slavko must draw the line x=1x=1 passing through (1,1)(1,1). This line also passes through (1,2)(1,2).
  • Then Mirko draws the line y=2y=2 passing through (1,2)(1,2). Slavko’s only remaining move is to draw x=1x=1 again, which is not allowed.
  • Mirko wins.

Constraints

For easier grading, this problem uses a special scoring method.

There are 4040 test cases in total.

  • Among them, 1616 test cases satisfy 1N101\le N\le 10.
  • The other 2424 test cases have no special restrictions.
  • Each of the first 2020 test cases is worth 44 points.
  • Each of the last 2020 test cases is worth 88 points.

For 100%100\% of the data, 1N1041\le N\le 10^4, 1X,Y5001\le X,Y\le 500.

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 160160 points.

Translated by ChatGPT 5