{"problem":{"name":"Taking the middle","description":{"content":"We have $2N$ cards, with ID numbers from $1$ through $2N$. Card $i$ has a value of $V_i$. Takahashi and Aoki will do the following procedure $N$ times so that each of them gets $N$ cards. *   First, ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc053_b"},"statements":[{"statement_type":"Markdown","content":"We have $2N$ cards, with ID numbers from $1$ through $2N$. Card $i$ has a value of $V_i$. Takahashi and Aoki will do the following procedure $N$ times so that each of them gets $N$ cards.\n\n*   First, Takahashi chooses one card that is not yet chosen and gets it. Then, Aoki chooses the card whose **ID number** is the median of those of the cards not yet chosen and gets it.\n\nFind the maximum possible sum of the values of cards Takahashi has in the end.\n\n## Constraints\n\n*   $1\\leq N\\leq 2\\times 10^5$\n*   $0\\leq V_i\\leq 10^9$\n*   $V_i$ is an integer.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$V_1$ $V_2$ $\\cdots$ $V_{2N}$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"agc053_b","tags":[],"sample_group":[["3\n1 2 3 4 5 6","15\n\nTakahashi can get Cards $4$, $5$, and $6$ as follows:\n\n*   First, Takahashi chooses Card $6$, which makes Aoki choose Card $3$.\n*   Next, Takahashi chooses Card $5$, which makes Aoki choose Card $2$.\n*   Lastly, Takahashi chooses Card $4$, which makes Aoki choose Card $1$."],["4\n1 4 5 8 7 6 3 2","20"]],"created_at":"2026-03-03 11:01:14"}}