{"kind":"task","effective_mode":"full","benchmark":{"kind":"benchmark","effective_mode":"full","slug":"livecodebench","formal_name":"LiveCodeBench","introduction":"LiveCodeBench continuously collects new competitive-programming problems to evaluate coding capabilities. Its initial release_v1 contains 400 problems, with source platform, contest date, and dataset version tracked explicitly.","introduction_ja":"","introduction_en":"","category":"Category not supplied","task_count":null,"acquisition_status":"Acquisition status not supplied","official_url":"https://livecodebench.github.io/","indexing_mode":"noindex","profile":{"resources":[],"task_format":"","scoring":"","metric":"","size":"","answer_access":"","license":"","citation":"","maintainer":"","released":"","why_hard":"","related":[]}},"task_id":"9337ceda-9f10-5426-9206-a6dd299c64dc","task_key":"release~5fv1--test--1883~5fC","task_revision_id":"2","upstream_id":"1883_C","short_description":"C. Raspberries","config":"release_v1","split":"test","body":"{\"contest_date\":\"2023-09-22T00:00:00\",\"contest_id\":\"1883\",\"difficulty\":\"medium\",\"platform\":\"codeforces\",\"question_content\":\"You are given an array of integers $a_1, a_2, \\\\ldots, a_n$ and a number $k$ ($2 \\\\leq k \\\\leq 5$). In one operation, you can do the following:\\n\\n\\n-  Choose an index $1 \\\\leq i \\\\leq n$,\\n-  Set $a_i = a_i + 1$.Find the minimum number of operations needed to make the product of all the numbers in the array $a_1 \\\\cdot a_2 \\\\cdot \\\\ldots \\\\cdot a_n$ divisible by $k$.\\n\\nInput\\n\\nEach test consists of multiple test cases. The first line contains a single integer $t$ ($1 \\\\leq t \\\\leq 10^4$) — the number of test cases. Then follows the description of the test cases.\\n\\nThe first line of each test case contains two integers $n$ and $k$ ($2 \\\\leq n \\\\leq 10^5$, $2 \\\\leq k \\\\leq 5$) — the size of the array $a$ and the number $k$.\\n\\nThe second line of each test case contains $n$ integers $a_1, a_2, \\\\ldots, a_n$ ($1 \\\\leq a_i \\\\leq 10$).\\n\\nIt is guaranteed that the sum of $n$ over all test cases does not exceed $2 \\\\cdot 10^5$.\\n\\nOutput\\n\\nFor each test case, output the minimum number of operations needed to make the product of all the numbers in the array divisible by $k$.Sample Input 1:\\n15\\n\\n2 5\\n\\n7 3\\n\\n3 3\\n\\n7 4 1\\n\\n5 2\\n\\n9 7 7 3 9\\n\\n5 5\\n\\n5 4 1 2 3\\n\\n7 4\\n\\n9 5 1 5 9 5 1\\n\\n3 4\\n\\n6 3 6\\n\\n3 4\\n\\n6 1 5\\n\\n3 4\\n\\n1 5 9\\n\\n4 4\\n\\n1 4 1 1\\n\\n3 4\\n\\n3 5 3\\n\\n4 5\\n\\n8 9 9 3\\n\\n2 5\\n\\n1 6\\n\\n2 5\\n\\n10 10\\n\\n4 5\\n\\n1 6 1 1\\n\\n2 5\\n\\n7 7\\n\\n\\n\\nSample Output 1:\\n\\n2\\n2\\n1\\n0\\n2\\n0\\n1\\n2\\n0\\n1\\n1\\n4\\n0\\n4\\n3\\n\\n\\nNote\\n\\nIn the first test case, we need to choose the index $i = 2$ twice. After that, the array will be $a = [7, 5]$. The product of all the numbers in the array is $35$.\\n\\nIn the fourth test case, the product of the numbers in the array is $120$, which is already divisible by $5$, so no operations are needed.\\n\\nIn the eighth test case, we can perform two operations by choosing $i = 2$ and $i = 3$ in any order. After that, the array will be $a = [1, 6, 10]$. The product of the numbers in the array is $60$.\",\"question_title\":\"C. Raspberries\",\"starter_code\":\"\"}","display_format":"text","language":"","answer_status":"external_grader","assets":[],"source_url":"https://livecodebench.github.io/","history":"initial import","indexing_mode":"noindex","subproblems":[],"grids":[]}