{"raw_statement":[{"iden":"statement","content":"Alice and Bob are playing a game. Alice has an array $a$ of $n$ integers, Bob has an array $b$ of $n$ integers. In each turn, a player removes one element of his array. Players take turns alternately. Alice goes first.\n\nThe game ends when both arrays contain exactly one element. Let $x$ be the last element in Alice's array and $y$ be the last element in Bob's array. Alice wants to maximize the absolute difference between $x$ and $y$ while Bob wants to minimize this value. Both players are playing optimally. \n\nFind what will be the final value of the game.\n\nThe first line contains a single integer $n$ ($1 <= n <= 1 thin 000$) — the number of values in each array.\n\nThe second line contains $n$ space-separated integers $a_1, a_2, \\\\dots, a_n$ ($1 <= a_i <= 10^9$) — the numbers in Alice's array.\n\nThe third line contains $n$ space-separated integers $b_1, b_2, \\\\dots, b_n$ ($1 <= b_i <= 10^9$) — the numbers in Bob's array.\n\nPrint the absolute difference between $x$ and $y$ if both players are playing optimally.\n\nIn the first example, the $x = 14$ and $y = 10$. Therefore, the difference between these two values is $4$. \n\nIn the second example, the size of the arrays is already $1$. Therefore, $x = 14$ and $y = 42$.\n\n"},{"iden":"input","content":"The first line contains a single integer $n$ ($1 <= n <= 1 thin 000$) — the number of values in each array.The second line contains $n$ space-separated integers $a_1, a_2, \\\\dots, a_n$ ($1 <= a_i <= 10^9$) — the numbers in Alice's array.The third line contains $n$ space-separated integers $b_1, b_2, \\\\dots, b_n$ ($1 <= b_i <= 10^9$) — the numbers in Bob's array."},{"iden":"output","content":"Print the absolute difference between $x$ and $y$ if both players are playing optimally."},{"iden":"examples","content":"Input4\n2 14 7 14\n5 10 9 22\nOutput4\nInput1\n14\n42\nOutput28\n"},{"iden":"note","content":"In the first example, the $x = 14$ and $y = 10$. Therefore, the difference between these two values is $4$. In the second example, the size of the arrays is already $1$. Therefore, $x = 14$ and $y = 42$."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the number of questions.  \nLet $ s = s_1 s_2 \\dots s_n $ be a string of length $ n $, where each $ s_i \\in \\{a, b, c, d, e\\} $ represents Ayoub's answer to question $ i $.  \nLet $ c \\in \\{a, b, c, d, e\\} $ be the unknown correct answer letter for all questions (uniform across all questions).  \n\n**Constraints**  \n$ 1 \\leq n \\leq 1000 $  \n$ s_i \\in \\{a, b, c, d, e\\} $ for all $ i \\in \\{1, \\dots, n\\} $\n\n**Objective**  \nFor each possible $ c \\in \\{a, b, c, d, e\\} $, define the number of correct answers as:  \n$$\nf(c) = \\sum_{i=1}^{n} \\mathbf{1}_{s_i = c}\n$$  \nCompute:  \n- Minimum: $ \\min_{c \\in \\{a,b,c,d,e\\}} f(c) $  \n- Maximum: $ \\max_{c \\in \\{a,b,c,d,e\\}} f(c) $  \n\nOutput: $ \\left( \\min_{c} f(c),\\ \\max_{c} f(c) \\right) $","simple_statement":"Ayoub took a multiple-choice exam with n questions. Each question has 5 options (a to e), and all correct answers are the same letter (but you don’t know which one). Ayoub wrote his answers in a string. Find the minimum and maximum number of correct answers he could have, depending on which letter was the true answer for all questions.","has_page_source":false}