{"kind":"task","effective_mode":"full","benchmark":{"kind":"benchmark","effective_mode":"full","slug":"hlce","formal_name":"Humanity's Last Code Exam","introduction":"Humanity's Last Code Exam evaluates problem solving and code generation using ICPC World Finals and IOI problems. The project describes 235 problems; this import selects its public ICPC dataset of 146 problems.","introduction_ja":"","introduction_en":"","category":"Category not supplied","task_count":null,"acquisition_status":"Acquisition status not supplied","official_url":"https://humanity-s-last-code-exam.github.io/website/","indexing_mode":"noindex","profile":{"resources":[],"task_format":"","scoring":"","metric":"","size":"","answer_access":"","license":"","citation":"","maintainer":"","released":"","why_hard":"","related":[]}},"task_id":"e13a547b-870d-5e9d-a945-622c4e14ecda","task_key":"ICPC~2dWorld~2dFinals--examples--2023~5fB","task_revision_id":"3","upstream_id":"2023_B","short_description":"Three Kinds of Dice","config":"ICPC-World-Finals","split":"examples","body":"{\"platform\":\"atcoder\",\"question_content\":\"The Institute for Creative Product Combinations (ICPC) tries to find unusual and innovative ways to unite seemingly unrelated products or technologies, opening up new markets and creating new jobs. For instance, their most recent success was the “hairbachi,” a hair-dryer with a hibachi grill top attachment for preparing on-the-go hot meals. The company employs \\\\( n \\\\) teams of size 2 to research individual products, then members of the different teams get together to explore ways of combining products.\\n\\nDuring the pandemic, the ICPC management organized everyone’s schedule in such a way that there were never more than \\\\( n \\\\) people in the office at the same time, and things ran so smoothly that they continued the process once things began to return to normal. Here is the scheme they used. Label the teams with integers 1 through \\\\( n \\\\) and the two people on the \\\\( i \\\\)-th team as \\\\((i, 1)\\\\) and \\\\((i, 2)\\\\) for each \\\\( i \\\\) from 1 to \\\\( n \\\\). Each week, exactly one person from each team is allowed in the office, while the other has to stay away. The employees \\\\((i, 1)\\\\) and \\\\((i, 2)\\\\) know each other well and collaborate productively regardless of being isolated from each other, so members of the same team do not need to meet in person in the office. However, isolation between members from different teams is still a concern.\\n\\nEach pair of teams \\\\( i \\\\) and \\\\( j \\\\) for \\\\( i \\\\neq j \\\\) has to collaborate occasionally. For a given number \\\\( w \\\\) of weeks and for fixed team members \\\\((i, a)\\\\) and \\\\((j, b)\\\\), let \\\\( w_1 < w_2 < \\\\ldots < w_k \\\\) be the weeks in which these two team members meet in the office. The isolation of those two people is the maximum of\\n\\n\\\\[\\n\\\\{w_1, w_2 - w_1, w_3 - w_2, \\\\ldots, w_k - w_{k-1}, w + 1 - w_k\\\\}\\n\\\\]\\n\\nor infinity if those two people never meet. The isolation of the whole company is the maximum isolation across all choices of \\\\( i, j, a, \\\\) and \\\\( b \\\\).\\n\\nYou have been tasked to find a weekly schedule that minimizes the isolation of the whole company over a given number \\\\( w \\\\) of weeks.\\n\\n### Input\\n\\nThe input consists of a single line containing two integers \\\\( n \\\\) and \\\\( w \\\\), where:\\n\\n- \\\\( 2 \\\\leq n \\\\leq 10^4 \\\\) is the number of teams.\\n- \\\\( 1 \\\\leq w \\\\leq 52 \\\\) is the number of weeks that need to be scheduled.\\n\\n### Output\\n\\nOutput a line containing either:\\n\\n- An integer representing the minimum isolation achievable for \\\\( n \\\\) teams, or\\n- The word \\\"infinity\\\" if no schedule guarantees that every pair of individuals on different teams can meet.\\n\\nIf the isolation is finite, it is followed by \\\\( w \\\\) lines representing a schedule that achieves this isolation. The \\\\( j \\\\)-th line of the schedule is a string of length \\\\( n \\\\) containing only the symbols 1 and 2, where the \\\\( i \\\\)-th symbol indicates which of the two members from team \\\\( i \\\\) comes into the office on week \\\\( j \\\\).\\n\\n### Sample Input and Output\\n\\n#### Sample Input 1\\n```\\n2 6\\n```\\n\\n#### Sample Output 1\\n```\\n4\\n11\\n12\\n21\\n22\\n11\\n12\\n```\\n\\n#### Sample Input 2\\n```\\n2 1\\n```\\n\\n#### Sample Output 2\\n```\\ninfinity\\n```\",\"question_title\":\"Three Kinds of Dice\"}","display_format":"text","language":"","answer_status":"published","assets":[],"source_url":"https://humanity-s-last-code-exam.github.io/website/","history":"initial import","indexing_mode":"noindex","subproblems":[],"grids":[]}