{"problem":{"name":"Sum of Mod","description":{"content":"You are given positive integers $N$ and $K$. Find one length-$N$ sequence of positive integers $A=(A_1,A_2,\\ldots,A_N)$ with the minimum value of $A_N$ among the ones that satisfy all of the following","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc208_b"},"statements":[{"statement_type":"Markdown","content":"You are given positive integers $N$ and $K$.\nFind one length-$N$ sequence of positive integers $A=(A_1,A_2,\\ldots,A_N)$ with the minimum value of $A_N$ among the ones that satisfy all of the following conditions.\n\n*   $A$ is non-decreasing. That is, $A_i \\le A_{i+1}$ for $1\\le i\\le N-1$.\n*   $\\displaystyle \\sum_{i=1}^{N-1} (A_{i+1} \\bmod A_i)=K$.\n\nYou are given $T$ test cases; solve each of them.\n\n## Constraints\n\n*   $1\\le T \\le 10^5$\n*   $2\\le N \\le 2\\times 10^5$\n*   The sum of $N$ over all test cases is at most $2\\times 10^5$.\n*   $1\\le K\\le 10^9$\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$T$\n$\\text{case}_1$\n$\\text{case}_2$\n$\\vdots$\n$\\text{case}_T$\n\nEach test case is given in the following format:\n\n$N$ $K$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc208_b","tags":[],"sample_group":[["2\n5 3\n2 3","1 2 3 4 5\n4 7\n\nConsider the first test case.\n$A=(1,2,3,4,5)$ is non-decreasing and satisfies $\\displaystyle \\sum_{i=1}^{N-1} (A_{i+1} \\bmod A_i) = (2\\bmod 1) + (3\\bmod 2) + (4\\bmod 3) + (5\\bmod 4)=3=K$, so it satisfies all conditions.\nThere does not exist an $A$ that satisfies all conditions and has a value of $A_N$ less than $5$, so printing $A=(1,2,3,4,5)$ will be accepted.\nOther than this, printing $A=(2,3,4,5,5)$ or $A=(2,3,3,5,5)$ will also be accepted."]],"created_at":"2026-03-03 11:01:14"}}