{"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":"5cceafc6-61fc-5a30-b963-47c6dfb1d1e1","task_key":"ICPC~2dWorld~2dFinals--examples--2023~5fK","task_revision_id":"2","upstream_id":"2023_K","short_description":"Alea Iacta Est","config":"ICPC-World-Finals","split":"examples","body":"{\"platform\":\"atcoder\",\"question_content\":\"You play a game with multiple fair six-sided dice. Each die’s face displays a single symbol. The objective of the game is to roll the dice and create a valid word from the symbols on top of each die. If you cannot form a word, you may reroll the dice for another attempt.\\n\\nSuppose there are five dice: one of them contains letters `A, B, C, D, E, and P` (abbreviated as `ABCDEP`), and the other dice contain letters `AEHOXU`, `AISOLR`, `ABCDEF`, and `ABCSCC`. The first roll yields the following letters on the tops of respective dice: `P, X, R, E, and S`. As it is impossible to arrange these letters into a valid word, you decide to keep the `P, S, and E`, and reroll the other dice, in an attempt to make words like `PARSE, PAUSE, PHASE, POISE, PROSE, PULSE, or PURSE`. The two dice yield `E and A`, resulting in the following five letters: `P, E, A, E, and S`. You still cannot think of a valid word, so you decide to keep four letters and reroll only the last die, which has three sides with letter `C`. By doing so, there is a 50% chance that it will be possible to make a final valid word: `PEACE`.\\n\\nWhen you roll a die, it lands on any one of its faces with equal probability. What is the expected number of rolls needed to make a valid word, assuming you use an optimal strategy?\\n\\n### Input\\n\\nThe first line of input contains two numbers \\\\(d\\\\) and \\\\(w\\\\), where \\\\(1 \\\\leq d \\\\leq 6\\\\) is the number of dice and \\\\(1 \\\\leq w \\\\leq 200,000\\\\) is the number of valid words in the dictionary. The following \\\\(d\\\\) lines each have 6 symbols, one for each face of the die. The final \\\\(w\\\\) lines contain \\\\(w\\\\) distinct valid words in the dictionary. Every word has exactly \\\\(d\\\\) symbols.\\n\\nAll symbols in the input are either uppercase letters (A–Z) or digits (0–9).\\n\\n### Output\\n\\nIf it is possible to make a valid word, output the expected number of rolls needed to make a valid word when using an optimal strategy. Otherwise, output `impossible`. Your answer should have an absolute or relative error of at most \\\\(10^{-6}\\\\).\\n\\n### Sample Input and Output\\n\\n#### Sample Input 1\\n```\\n5 8\\nABCDEP\\nAEHOXU\\nAISOLR\\nABCDEF\\nABCSCC\\nPARSE\\nPAUSE\\nPHASE\\nPOISE\\nPROSE\\nPULSE\\nPURSE\\nPEACE\\n```\\n\\n#### Sample Output 1\\n```\\n9.677887141\\n```\\n\\n#### Sample Input 2\\n```\\n2 1\\nAAAAAA\\nBBBBBB\\nAB\\n```\\n\\n#### Sample Output 2\\n```\\n1.0\\n```\\n\\n#### Sample Input 3\\n```\\n3 1\\n123456\\n123456\\n123456\\n666\\n```\\n\\n#### Sample Output 3\\n```\\n10.555444555\\n```\\n\\n#### Sample Input 4\\n```\\n2 1\\nABCDEF\\nGHI234\\nAB\\n```\\n\\n#### Sample Output 4\\n```\\nimpossible\\n```\",\"question_title\":\"Alea Iacta Est\"}","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":[]}