{"raw_statement":[{"iden":"statement","content":"The complete problemset is available on http://maratona.ime.usp.br/primfase19/provas/competicao/maratona_en.pdf\n\n"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**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$$","simple_statement":"You are given a two-story building with n tables on each floor. Some tables have teams working at them (marked by '1'), others are empty ('0'). You must place a printer on one table (on either floor) to minimize the worst-case inconvenience for any team.\n\nInconvenience for a team:\n- If printer is on same floor: distance = |team_table - printer_table|\n- If printer is on other floor: inconvenience = team_table + k + printer_table (go to exit, use stairs, walk to printer)\n\nFind the floor and table to place the printer so that the maximum inconvenience among all teams is as small as possible.\n\nOutput:\n1. The minimum possible maximum inconvenience\n2. The floor (1 or 2) and table number (1 to n) where the printer should be placed","has_page_source":false}