| MITIT Winter 2025 Beginner Round |
|---|
| Finished |
Busy Beaver has discovered that someone has mixed up his toy marbles!
There are $$$N$$$ containers, numbered from $$$1$$$ to $$$N$$$. The $$$i$$$-th container currently contains a single marble of color $$$c_i$$$.
Busy Beaver wants to tidy up his marbles so that the $$$i$$$-th container only contains marbles of color $$$i$$$. To achieve this, he can perform either of the following actions any number of times (possibly zero):
Find a way to organize the marbles using the minimum number of actions.
The first line contains an integer $$$N$$$ ($$$1 \leq N \leq 2 \cdot 10^5$$$) — the number of containers.
The second line contains $$$N$$$ integers $$$c_1, c_2, \dots, c_N$$$ ($$$1 \leq c_i \leq N$$$) — the marble initially in each container.
On the first line, print a single integer $$$K$$$ — the minimum number of actions required.
On the next $$$K$$$ lines, describe the actions in order, one per line. Each action should be in one of the following formats:
If there are multiple ways to achieve the goal in the minimum number of actions, you may print any valid solution.
There are two subtasks for this problem.
42 4 3 1
2 1 2 4 1 1 2
83 6 7 6 3 6 8 3
6 2 6 4 2 6 2 1 8 7 1 7 3 2 3 1 2 3 5
In the first test case, it is able to achieve the goal in two actions:
It is impossible to achieve the goal in less than two actions.
| Name |
|---|


