[Usaco2007 China]The Bovine Accordion and Banjo Orchestra 音乐会

时间限制:5s    【提交】    空间限制:64MB

题目描述


输入格式

  1行输入N,之后N行输入Ai,之后N行输入Bi


输出格式

  输出最大收益.


样例输入

3
1
1
5
5
1
1

INPUT DETAILS:

There are 6 cows: 3 accordionists and 3 banjoists. The accordionists have
talent levels (1, 1, 5), and the banjoists have talent levels (5, 1, 1).


样例输出

17

提示

 手风琴手3和班卓琴手1搭配,创造收益25美元.手风琴手1和手风琴手2喝酒用了4美元.同样班卓琴手2和班卓琴手3用了4美元.最后收益为25 -4-4=17美元.


题目来源

Gold