{"problem":{"name":"M. Value","description":{"content":"_Pang_ believes that one cannot make an omelet without breaking eggs. For a subset $A$ of ${1, 2, \\\\dots, n}$, we calculate the score of $A$ as follows:  The first line contains a single integer $n$","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10247M"},"statements":[{"statement_type":"Markdown","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## Input\n\nThe 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)$.\n\n## Output\n\nPrint a single integer $x$ — the maximum possible score.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**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 $.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10247M","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}