Problem Statement
You are given two integer sequences of length $N$: $A=(A_1,A_2,\dots,A_N)$ and $B=(B_1,B_2,\dots,B_N)$.
You may perform at most $31000$ operations of the following kind:
- Choose a pair of integers
$(i,j)$with$1 \le i < j \le N$, then replace$A_i$with$A_j - 1$and$A_j$with$A_i + 1$.
Your goal is to make $A = B$. Determine whether the goal is achievable, and if it is, output one sequence of operations that achieves it.
Constraints
$2 \le N \le 100$$1 \le A_i,B_i \le 100$
Input
The input is given from Standard Input in the following format:
N
A_1\ A_2\ \dots\ A_N
B_1\ B_2\ \dots\ B_N
Output
If it is possible to make $A = B$, output Yes; otherwise, output No.
If you output Yes, also output an operation sequence in the following format:
M
i_1\ j_1
i_2\ j_2
\vdots
i_M\ j_M
$M$ is the length of the operation sequence and must satisfy $0 \le M \le 31000$. $i_k, j_k$ are the indices $i, j$ chosen in the $k$-th operation and must satisfy $1 \le i_k < j_k \le N$.
If multiple solutions exist, any of them will be accepted.
样例
4
2 2 1 4
3 2 2 2
Yes
2
1 4
3 4
6
5 4 4 3 4 2
5 1 2 3 4 1
No
7
2 4 2 4 3 2 5
5 4 3 2 5 1 2
Yes
18
5 7
1 7
2 4
1 5
1 5
1 4
4 5
4 5
3 4
5 7
1 5
1 7
1 6
6 7
1 7
2 4
2 5
4 5
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。