{"problem":{"name":"Make Multiples","description":{"content":"You are given an integer sequence $A=(A_1,\\ldots,A_N)$ and positive integers $a$, $b$, and $c$. You can perform the following operation on this sequence any number of times, possibly zero. *   Choose","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc166_b"},"statements":[{"statement_type":"Markdown","content":"You are given an integer sequence $A=(A_1,\\ldots,A_N)$ and positive integers $a$, $b$, and $c$.\nYou can perform the following operation on this sequence any number of times, possibly zero.\n\n*   Choose an integer $i$ such that $1\\leq i\\leq N$. Replace $A_i$ with $A_i+1$.\n\nYour objective is to make the sequence $A$ contain at least one multiple of $a$, at least one multiple of $b$, and at least one multiple of $c$. Find the minimum number of operations required to achieve this objective.\n\n## Constraints\n\n*   $1\\leq N\\leq 2\\times 10^5$\n*   $1\\leq a, b, c \\leq 10^6$\n*   $1\\leq A_i\\leq 10^{18}$\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$ $a$ $b$ $c$\n$A_1$ $\\cdots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc166_b","tags":[],"sample_group":[["3 3 4 5\n8 9 11","2\n\nYou can perform the operation twice so that $A = (8,10,12)$ to achieve the objective."],["3 3 4 5\n14 11 59","1\n\nYou can perform the operation once so that $A = (14,11,60)$ to achieve the objective."],["6 10 20 30\n8 17 5 28 39 13","3\n\nYou can perform the operation three times so that $A = (8,17,5,30,40,13)$ to achieve the objective."],["1 999997 999998 999999\n123456789123456789","876537210887543205\n\nYou can perform the operation $876537210887543205$ times so that $A = (999994000010999994)$ to achieve the objective."]],"created_at":"2026-03-03 11:01:14"}}