logo AlgoBeat OnlineJudge
登录 注册

#215709. [ICPC 2025 Jakarta R] Nihilation

内存限制:2048 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

You are given an array consisting of positive integers.

In one operation, you can choose integers and such that and set for .

What is the minimum number of operations needed to make all equal to ?

Output any sequence of operations to be done. It can be proven that it is always possible to make all equal to .

输入格式

Input begins with an integer (). The next line contains integers () representing the given array .

输出格式

In the first line, output the minimum number of operations needed.

In the next lines, output two integers and , representing the operation in the sequence of operations that makes all equal to .

If there are multiple such sequences, output any one of them.

样例

样例输入 1

5
4 1 2 6 3

样例输出 1

2
12 6
3 2

样例输入 2

2
9 9

样例输出 2

1
3 1

数据范围与提示

The following describes the sequence of operations done in the sample output.

It can be shown that no sequence of operations with length can make all equal to .