{"problem":{"name":"L. Less Coin Tosses","description":{"content":"The complete problemset is available on http://maratona.ime.usp.br/primfase19/provas/competicao/maratona_en.pdf ","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10234L"},"statements":[{"statement_type":"Markdown","content":"The complete problemset is available on http://maratona.ime.usp.br/primfase19/provas/competicao/maratona_en.pdf\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ n, k \\in \\mathbb{Z}^+ $: number of tables per floor, staircase cost.  \nLet $ S_2 \\in \\{0,1\\}^n $: binary string indicating team presence on second floor (index 1 to $n$).  \nLet $ S_1 \\in \\{0,1\\}^n $: binary string indicating team presence on first floor (index 1 to $n$).  \nLet $ T_1 = \\{ i \\in \\{1, \\dots, n\\} \\mid S_1[i-1] = 1 \\} $: set of table indices with teams on floor 1.  \nLet $ T_2 = \\{ i \\in \\{1, \\dots, n\\} \\mid S_2[i-1] = 1 \\} $: set of table indices with teams on floor 2.  \n\nLet $ p \\in \\{1,2\\} \\times \\{1, \\dots, n\\} $: printer location (floor, table).  \n\n**Inconvenience Function**  \nFor team at $ (f, a) \\in (T_1 \\times \\{1\\}) \\cup (T_2 \\times \\{2\\}) $ and printer at $ (p_f, p_a) $:  \n$$\n\\text{inconvenience}(f, a, p_f, p_a) = \n\\begin{cases}\n|a - p_a| & \\text{if } f = p_f \\\\\na + k + p_a & \\text{if } f \\ne p_f\n\\end{cases}\n$$\n\n**Constraints**  \n- $ T_1 \\cup T_2 \\ne \\emptyset $ (at least one team).  \n- Printer may be placed at any table (occupied or unoccupied) on either floor: $ p_f \\in \\{1,2\\},\\ p_a \\in \\{1, \\dots, n\\} $.  \n\n**Objective**  \nFind $ p^* = (p_f^*, p_a^*) $ minimizing:  \n$$\n\\min_{p_f \\in \\{1,2\\},\\ p_a \\in \\{1,\\dots,n\\}} \\max_{(f,a) \\in T_1 \\cup T_2} \\text{inconvenience}(f, a, p_f, p_a)\n$$","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10234L","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}