#P7579. 「RdOI R2」称重(weigh)

「RdOI R2」称重(weigh)

Background

Because rui_er is a conscientious problem setter, this problem is an interactive problem.

Problem Description

To prepare for the physical fitness test, rui_er bought nn solid shot puts for practice, but found that during shipping, two balls with obviously lighter mass but similar appearance were mixed in (these two balls have the same mass). It is also known that the sum of the masses of these two balls is greater than that of one normal ball. To avoid affecting the training results, we now need to find these two lighter balls. Since searching manually is too slow, rui_er brings a balance scale, which can place several balls on each side and obtain the comparison of the total masses on the two sides. Please help rui_er find the two lighter balls using no more than kk weighings.

Here, kk is an attribute of each test point. You do not need to and should not read it.


Interaction Method

This problem uses I/O interaction.

You may choose to perform a weighing operation. In that case, print one line to standard output: 1 p a1 a2 ... ap q b1 b2 ... bq, meaning that pp balls with indices a1,a2,,apa_1,a_2,\cdots,a_p are placed on the left pan, and qq balls with indices b1,b2,,bqb_1,b_2,\cdots,b_q are placed on the right pan. Then flush the buffer, and read from standard input one character among <>=, indicating the mass relationship between the left and right pans.

For each such query, you must ensure 1p,qn1\le p,q\le n, p+qnp+q\le n, all aia_i and bib_i are pairwise distinct, and you may perform at most kk such queries.

After obtaining the answer, print one line to standard output: 2 x y to submit the answer, meaning that the balls with indices xx and yy have smaller mass.

You must ensure 1x<yn1\le x\lt y\le n (note that you must output in strictly increasing order), and terminate the program immediately after performing this operation.

The interaction library has already fixed the actual situation of the balls at the beginning, and it will not change with your queries.

Input Format

The first line contains an integer nn, indicating the number of balls. Here, kk is an attribute of each test point. You do not need to and should not read it.

The next several lines are as described in [Interaction Method].

Output Format

Several lines, as described in [Interaction Method].

6

=

<

>

1 1 1 1 2

1 1 3 1 4

1 1 5 1 6

2 3 6

Hint

Sample Explanation

The results of three queries are a1=a2,a3<a4,a5>a6a_1=a_2,a_3\lt a_4,a_5\gt a_6. Thus, we can determine that the two balls with indices 3,63,6 have smaller mass.


Constraints

This problem uses partial scoring by test point.

Among the 2020 non-HACK test points, the first test point is worth 44 points, and each of the others is worth 55 points. The 44 HACK test points are worth a total of 11 point. If any test point is not passed, no points are awarded.

Test Point nn\le k=k= Special Property Test Point nn\le k=k= Special Property
1 55 5050 None 11 500500 5050 None
2 1010 12
3 100100 13 2020 A
4 14 B
5 500500 A 15 A
6 B 16 B
7 A 17 None
8 B 18
9 None 19
10 20
ex1 1212 B/HACK ex3 1313 HACK
ex2 1313 HACK ex4 1414
  • Special Property A: n=2i1,i{4,5,6,7,8}n=2^i-1,i\in\left\{4,5,6,7,8\right\}.
  • Special Property B: n=2i,i{4,5,6,7,8}n=2^i,i\in\left\{4,5,6,7,8\right\}.
  • Note: For HACK testdata, kk is set according to the actual test point settings. It will block some weird approaches and ensure that the intended solution can pass.

For all data, 5n5005\le n\le 500, k{50,20,14,13,12}k\in\left\{50,20,14,13,12\right\}.

Translated by ChatGPT 5