{"raw_statement":[{"iden":"statement","content":"*This is the easy version of this problem.The only difference is that you can perform at most $n$ operations.*\n\nYou are given two binary strings $a$ and $b$ of the same length $n$.\n\nYou can perform the following operation: \n\nOutput any scheme to transform $a$ into $b$ by performing at most $n$ operations.If there's no such scheme,output $-1$ instead.\n\nThe first line of the input contains a single integer $t$ ($1 <= t <= 10^4$) — the number of test cases. The description of the test cases follows.\n\nThe first line of each test case contains a single integer $n$ ($1 <= n <= 2 dot.op 10^5$).\n\nThe second line contains the binary string $a$ of length $n$.\n\nThe third line contains the binary string $b$ of length $n$.\n\nThe sum of $n$ over all test cases does not exceed $2 dot.op 10^5$.\n\nFor each test case, if it is impossible to transform $a$ into $b$ by performing such operations, output $-1$.\n\nOtherwise, output $2$ lines.\n\nThe first line should contain a single integer $m$ ($0 <= m <= n$) — the number of operations.\n\nThe second line should contain $m$ integers ($1 <= i_1, i_2, \\\\dots, i_m <= n$) — indices defining the operations.\n\nIt is guaranteed that if there is a way to transform $a$ into $b$, then it can be done in at most $n$ operations.\n\n"},{"iden":"input","content":"The first line of the input contains a single integer $t$ ($1 <= t <= 10^4$) — the number of test cases. The description of the test cases follows.The first line of each test case contains a single integer $n$ ($1 <= n <= 2 dot.op 10^5$).The second line contains the binary string $a$ of length $n$.The third line contains the binary string $b$ of length $n$.The sum of $n$ over all test cases does not exceed $2 dot.op 10^5$."},{"iden":"output","content":"For each test case, if it is impossible to transform $a$ into $b$ by performing such operations, output $-1$.Otherwise, output $2$ lines.The first line should contain a single integer $m$ ($0 <= m <= n$) — the number of operations.The second line should contain $m$ integers ($1 <= i_1, i_2, \\\\dots, i_m <= n$) — indices defining the operations.It is guaranteed that if there is a way to transform $a$ into $b$, then it can be done in at most $n$ operations."}],"translated_statement":[{"iden":"statement","content":"*这是本题的简单版本，唯一的区别是你可以执行至多 $n$ 次操作。*\n\n给你两个长度均为 $n$ 的二进制字符串 $a$ 和 $b$。\n\n你可以执行以下操作：\n\n请输出一种方案，通过执行至多 $n$ 次操作将 $a$ 转换为 $b$。如果不存在这样的方案，则输出 $-1$。\n\n输入的第一行包含一个整数 $t$ ($1 lt.eq t lt.eq 10^4$) —— 测试用例的数量。接下来是测试用例的描述。\n\n每个测试用例的第一行包含一个整数 $n$ ($1 lt.eq n lt.eq 2 dot.op 10^5$)。\n\n第二行包含长度为 $n$ 的二进制字符串 $a$。\n\n第三行包含长度为 $n$ 的二进制字符串 $b$。\n\n所有测试用例的 $n$ 之和不超过 $2 dot.op 10^5$。\n\n对于每个测试用例，如果无法通过上述操作将 $a$ 转换为 $b$，则输出 $-1$。\n\n否则，输出两行：\n\n第一行应包含一个整数 $m$ ($0 lt.eq m lt.eq n$) —— 操作次数。\n\n第二行应包含 $m$ 个整数 ($1 lt.eq i_1, i_2, dots.h, i_m lt.eq n$) —— 定义操作的索引。\n\n保证如果存在将 $a$ 转换为 $b$ 的方法，则可以在至多 $n$ 次操作内完成。"},{"iden":"input","content":"输入的第一行包含一个整数 $t$ ($1 lt.eq t lt.eq 10^4$) —— 测试用例的数量。接下来是测试用例的描述。每个测试用例的第一行包含一个整数 $n$ ($1 lt.eq n lt.eq 2 dot.op 10^5$)。第二行包含长度为 $n$ 的二进制字符串 $a$。第三行包含长度为 $n$ 的二进制字符串 $b$。所有测试用例的 $n$ 之和不超过 $2 dot.op 10^5$。"},{"iden":"output","content":"对于每个测试用例，如果无法通过上述操作将 $a$ 转换为 $b$，则输出 $-1$。否则，输出两行：第一行应包含一个整数 $m$ ($0 lt.eq m lt.eq n$) —— 操作次数。第二行应包含 $m$ 个整数 ($1 lt.eq i_1, i_2, dots.h, i_m lt.eq n$) —— 定义操作的索引。保证如果存在将 $a$ 转换为 $b$ 的方法，则可以在至多 $n$ 次操作内完成。"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ t \\in \\mathbb{Z} $ be the number of test cases.  \nFor each test case $ k \\in \\{1, \\dots, t\\} $:  \n- Let $ n_k \\in \\mathbb{Z} $ be the length of binary strings.  \n- Let $ a_k = (a_{k,1}, \\dots, a_{k,n_k}) \\in \\{0,1\\}^{n_k} $, $ b_k = (b_{k,1}, \\dots, b_{k,n_k}) \\in \\{0,1\\}^{n_k} $ be the input binary strings.  \n\n**Constraints**  \n1. $ 1 \\le t \\le 10^4 $  \n2. $ 1 \\le n_k \\le 2 \\cdot 10^5 $ for each $ k $  \n3. $ \\sum_{k=1}^t n_k \\le 2 \\cdot 10^5 $  \n\n**Objective**  \nFor each test case $ k $, find a sequence of indices $ i_1, \\dots, i_m \\in \\{1, \\dots, n_k\\} $ with $ 0 \\le m \\le n_k $, such that applying the operation (flip prefix of length $ i_j $) to $ a_k $ in order yields $ b_k $.  \nIf no such sequence exists, output $ -1 $.  \n\n**Operation**  \nAn operation at index $ i $ flips all bits in the prefix $ a_{k,1}, \\dots, a_{k,i} $:  \n$ a_{k,j} \\leftarrow 1 - a_{k,j} $ for all $ j \\le i $.","simple_statement":null,"has_page_source":false}