{"problem":{"name":"Kth Excluded","description":{"content":"You are given a sequence of $N$ positive integers: $A = (A_1, A_2, \\dots, A_N)$, and $Q$ queries. In the $i$\\-th query $(1 \\leq i \\leq Q)$, given a positive integer $K_i$, find the $K_i$\\-th smallest ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":3000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc205_d"},"statements":[{"statement_type":"Markdown","content":"You are given a sequence of $N$ positive integers: $A = (A_1, A_2, \\dots, A_N)$, and $Q$ queries.\nIn the $i$\\-th query $(1 \\leq i \\leq Q)$, given a positive integer $K_i$, find the $K_i$\\-th smallest integer among the positive integers that differ from all of $A_1, A_2, \\dots, A_N$.\n\n## Constraints\n\n*   $1 \\leq N, Q \\leq 10^5$\n*   $1 \\leq A_1 < A_2 < \\dots < A_N \\leq 10^{18}$\n*   $1 \\leq K_i \\leq 10^{18}$\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $Q$\n$A_1$ $A_2$ $\\ldots$ $A_N$\n$K_1$\n$K_2$\n$\\vdots$\n$K_Q$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc205_d","tags":[],"sample_group":[["4 3\n3 5 6 7\n2\n5\n3","2\n9\n4\n\nThe positive integers that differ from all of $A_1, A_2, \\dots, A_N$ are $1, 2, 4, 8, 9, 10, 11, \\dots$ in ascending order. The second, fifth, and third smallest of them are $2$, $9$, and $4$, respectively."],["5 2\n1 2 3 4 5\n1\n10","6\n15"]],"created_at":"2026-03-03 11:01:14"}}