Universal Cup Judging System

Universal Cup

Límite de tiempo: 1.0 s Límite de memoria: 512 MB Puntuación total: 100 Hackeable ✓
Estadísticas

A good problem should have a concise statement.

You are given an array $a$ of length $n$, initially filled with zeros, and another array $b$ of length $n$. Your goal is to transform array $a$ into array $b$. You can perform the following two types of operations:

  • $1\ x$: Add $1$ to all elements in $a$ that are equal to $x$.
  • $2\ x$: Add $1$ to the element in $a$ at index $x$.

You can perform no more than $20\,000$ operations.

Input

The first line contains a positive integer $n$ ($1 \le n \le 1000$).

The second line contains $n$ non-negative integers representing the array $b$ ($0 \le b_i \le n$).

Output

The first line should contain an integer $k$, representing the number of operations.

The following $k$ lines should each contain two integers $1\ x$ or $2\ x$, representing an operation. For the operation type $1\ x$, you must ensure that $0 \le x \le n$. For the operation type $2\ x$, you must ensure that $1 \le x \le n$.

Examples

Input 1

4
2 4 3 1

Output 1

8
2 1
2 2
2 3
1 1
2 4
2 2
2 3
2 2

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.