{"problem":{"name":"Error Swap","description":{"content":"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","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc198_c"},"statements":[{"statement_type":"Markdown","content":"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)$.\nYou may perform at most $31000$ operations of the following kind:\n\n*   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$.\n\nYour goal is to make $A = B$. Determine whether the goal is achievable, and if it is, output one sequence of operations that achieves it.\n\n## Constraints\n\n*   $2 \\le N \\le 100$\n*   $1 \\le A_i,B_i \\le 100$\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$\n$A_1\\ A_2\\ \\dots\\ A_N$\n$B_1\\ B_2\\ \\dots\\ B_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc198_c","tags":[],"sample_group":[["4\n2 2 1 4\n3 2 2 2","Yes\n2\n1 4\n3 4\n\nThe following operations make $A = B$:\n\n*   Choose $(i,j) = (1,4)$. Then $A = (3,2,1,3)$.\n*   Choose $(i,j) = (3,4)$. Then $A = (3,2,2,2)$.\n\nSince minimizing the number of operations is not required, the following output is also accepted:\n\nYes\n6\n1 4\n3 4\n1 2\n1 2\n1 2\n1 2"],["6\n5 4 4 3 4 2\n5 1 2 3 4 1","No"],["7\n2 4 2 4 3 2 5\n5 4 3 2 5 1 2","Yes\n18\n5 7\n1 7\n2 4\n1 5\n1 5\n1 4\n4 5\n4 5\n3 4\n5 7\n1 5\n1 7\n1 6\n6 7\n1 7\n2 4\n2 5\n4 5"]],"created_at":"2026-03-03 11:01:13"}}