{"raw_statement":[{"iden":"statement","content":"_Pang_ believes that one cannot make an omelet without breaking eggs.\n\nFor a subset $A$ of ${1, 2, \\\\dots, n}$, we calculate the score of $A$ as follows: \n\nThe first line contains a single integer $n$ $(1 <= n <= 100000)$.\n\nThe second line contains $n$ integers $a_1, a_2, \\\\dots, a_n$ $(1 <= a_i <= 1000000000)$.\n\nThe third line contains $n$ integers $b_1, b_2, \\\\dots, b_n$ $(1 <= b_i <= 1000000000)$.\n\nPrint a single integer $x$ — the maximum possible score.\n\n"},{"iden":"input","content":"The first line contains a single integer $n$ $(1 <= n <= 100000)$.The second line contains $n$ integers $a_1, a_2, \\\\dots, a_n$ $(1 <= a_i <= 1000000000)$.The third line contains $n$ integers $b_1, b_2, \\\\dots, b_n$ $(1 <= b_i <= 1000000000)$."},{"iden":"output","content":"Print a single integer $x$ — the maximum possible score."},{"iden":"examples","content":"Input4\n1 1 1 2\n1 1 1 1\nOutput4\nInput4\n1 1 1 1\n1 1 1 2\nOutput3\n"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ with $ 1 \\leq n \\leq 100000 $.  \nLet $ A = \\{1, 2, \\dots, n\\} $.  \nLet $ \\mathbf{a} = (a_1, a_2, \\dots, a_n) \\in \\mathbb{Z}^n $ with $ 1 \\leq a_i \\leq 10^9 $.  \nLet $ \\mathbf{b} = (b_1, b_2, \\dots, b_n) \\in \\mathbb{Z}^n $ with $ 1 \\leq b_i \\leq 10^9 $.  \n\nFor a subset $ S \\subseteq A $, define the score as:  \n$$\n\\text{score}(S) = \\sum_{i \\in S} a_i - \\sum_{i \\notin S} b_i\n$$\n\n**Objective**  \nMaximize $ \\text{score}(S) $ over all subsets $ S \\subseteq A $.","simple_statement":"Given two arrays a and b of length n, choose a subset of indices to maximize the sum of a[i] for chosen indices minus the sum of b[i] for unchosen indices.","has_page_source":false}