1778: 平均分配-CCF-GESP2025年3月五级C++

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:1 Solved:0

Description

⼩ A 有2n  件物品,⼩ B 和⼩ C 想从⼩ A ⼿上买⾛这些物品。对于第 i 件物品,⼩ B 会以b 的价格购买,⽽⼩ C 会
以ci的价格购买。为了平均分配这2n  件物品,⼩ A 决定⼩ B 和⼩ C 各⾃只能买⾛恰好n  件物品。你能帮⼩ A 求出
他卖出这2n  件物品所能获得的最⼤收⼊吗?

Input


Output

⼀⾏,⼀个整数,表⽰答案。

Sample Input Copy

3
1 3 5 6 8 10
2 4 6 7 9 11

Sample Output Copy

36

HINT