{"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":"08bc7ab1-b09e-5d9d-b629-2e687274d95f","task_key":"release~5fv1--test--1899~5fB","task_revision_id":"1","upstream_id":"1899_B","short_description":"B. 250 Thousand Tons of TNT","config":"release_v1","split":"test","body":"{\"contest_date\":\"2023-10-17T00:00:00\",\"contest_id\":\"1899\",\"difficulty\":\"hard\",\"platform\":\"codeforces\",\"question_content\":\"Alex is participating in the filming of another video of BrMeast, and BrMeast asked Alex to prepare 250 thousand tons of TNT, but Alex didn't hear him well, so he prepared $n$ boxes and arranged them in a row waiting for trucks. The $i$-th box from the left weighs $a_i$ tons.\\n\\nAll trucks that Alex is going to use hold the same number of boxes, denoted by $k$. Loading happens the following way:\\n\\n \\n-  The first $k$ boxes goes to the first truck, \\n-  The second $k$ boxes goes to the second truck, \\n-  $\\\\dotsb$ \\n-  The last $k$ boxes goes to the $\\\\frac{n}{k}$-th truck. Upon loading is completed, each truck must have exactly $k$ boxes. In other words, if at some point it is not possible to load exactly $k$ boxes into the truck, then the loading option with that $k$ is not possible.\\n\\nAlex hates justice, so he wants the maximum absolute difference between the total weights of two trucks to be as great as possible. If there is only one truck, this value is $0$.\\n\\nAlex has quite a lot of connections, so for every $1 \\\\leq k \\\\leq n$, he can find a company such that each of its trucks can hold exactly $k$ boxes. Print the maximum absolute difference between the total weights of any two trucks.\\n\\nInput\\n\\nThe first line contains one integer $t$ ($1 \\\\leq t \\\\leq 10^4$) — the number of test cases.\\n\\nThe first line of each test case contains one integer $n$ ($1 \\\\leq n \\\\leq 150\\\\,000$) — the number of boxes.\\n\\nThe second line contains $n$ integers $a_1, a_2, \\\\dots, a_n$ ($1 \\\\leq a_i \\\\leq 10^9$) — the weights of the boxes.\\n\\nIt is guaranteed that the sum of $n$ for all test cases does not exceed $150\\\\,000$.\\n\\nOutput\\n\\nFor each test case, print a single integer — the answer to the problem.Sample Input 1:\\n5\\n\\n2\\n\\n1 2\\n\\n6\\n\\n10 2 3 6 1 3\\n\\n4\\n\\n1000000000 1000000000 1000000000 1000000000\\n\\n15\\n\\n60978 82265 78961 56708 39846 31071 4913 4769 29092 91348 64119 72421 98405 222 14294\\n\\n8\\n\\n19957 69913 37531 96991 57838 21008 14207 19198\\n\\n\\n\\nSample Output 1:\\n\\n1\\n9\\n0\\n189114\\n112141\\n\\n\\nNote\\n\\nIn the first case, we should pick two trucks, so the first one will have only the first box, and the second one will have only the second box.\\n\\nIn the second case, we should pick six trucks, so the maximum will be $10$, the minimum will be $1$, and the answer is $10 - 1 = 9$.\\n\\nIn the third case, for any possible $k$, the trucks will have the same total weight of boxes, so the answer is $0$.\",\"question_title\":\"B. 250 Thousand Tons of TNT\",\"starter_code\":\"\"}","display_format":"text","language":"","answer_status":"published","assets":[],"source_url":"https://livecodebench.github.io/","history":"initial import","indexing_mode":"noindex","subproblems":[],"grids":[]}