{"problem":{"name":"Add Mod Operations","description":{"content":"You are given sequences of non-negative integers: $A = (A_1, \\ldots, A_N)$ and $B=(B_1, \\ldots, B_N)$. Determine whether one can make $A$ equal $B$ by performing the following operation between $0$ an","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc063_c"},"statements":[{"statement_type":"Markdown","content":"You are given sequences of non-negative integers: $A = (A_1, \\ldots, A_N)$ and $B=(B_1, \\ldots, B_N)$.\nDetermine whether one can make $A$ equal $B$ by performing the following operation between $0$ and $N$ times, inclusive.\n\n*   Operation: Choose integers $x,y$ such that $0\\leq x < y\\leq 10^{18}$. For every $i$, replace $A_i$ with $(A_i+x)\\bmod y$.\n\nIf one can make $A$ equal $B$, print one way to do so.\n\n## Constraints\n\n*   $1\\leq N\\leq 1000$\n*   $0\\leq A_i\\leq 10^9$\n*   $0\\leq B_i\\leq 10^9$\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $\\ldots$ $A_N$\n$B_1$ $\\ldots$ $B_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"agc063_c","tags":[],"sample_group":[["4\n7 2 4 5\n3 3 5 0","Yes\n2\n3 5\n3 6\n\nOne can make $A$ equal $B$ as follows.\n\n*   Initially, $A = (7,2,4,5)$.\n*   The operation with $(x,y) = (3,5)$ makes $A = (0,0,2,3)$.\n*   The operation with $(x,y) = (3,6)$ makes $A = (3,3,5,0)$."],["1\n5\n3","Yes\n1\n2 4"],["2\n3 1\n3 1","Yes\n0"],["2\n0 0\n1 2","No"]],"created_at":"2026-03-03 11:01:14"}}