{"problem":{"name":"Increasing Minimum","description":{"content":"Consider doing the operation below on a sequence of $N$ positive integers $A = (A_1, A_2, \\ldots, A_N)$ to obtain a sequence $I = (i_1, i_2, \\ldots, i_K)$. *   For each $k = 1, 2, \\ldots, K$ in this ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc130_e"},"statements":[{"statement_type":"Markdown","content":"Consider doing the operation below on a sequence of $N$ positive integers $A = (A_1, A_2, \\ldots, A_N)$ to obtain a sequence $I = (i_1, i_2, \\ldots, i_K)$.\n\n*   For each $k = 1, 2, \\ldots, K$ in this order, do the following.\n    *   Choose an $i$ such that $A_i = \\min{A_1, A_2, \\ldots, A_N}$.\n    *   Let $i_k = i$.\n    *   Add $1$ to $A_i$.\n\nYou are given integers $N$, $K$, and a sequence $I$.\nDetermine whether there exists a sequence of positive integers $A$ for which it is possible to obtain $I$ from the operation. If it exists, find the lexicographically smallest such sequence.\n\n## Constraints\n\n*   $1\\leq N, K\\leq 3\\times 10^5$\n*   $1\\leq i_k\\leq N$\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $K$\n$i_1$ $i_2$ $\\ldots$ $i_K$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc130_e","tags":[],"sample_group":[["4 6\n1 1 4 4 2 1","1 3 3 2\n\nSome of the sequences for which it is possible to obtain $I = (1,1,4,4,2,1)$ from the operation are $(1, 3, 3, 2)$ and $(2, 4, 5, 3)$. The lexicographically smallest among them is $(1, 3, 3, 2)$."],["4 6\n2 2 2 2 2 2","6 1 6 6"],["4 6\n1 1 2 2 3 3","\\-1"]],"created_at":"2026-03-03 11:01:13"}}