Yolo has $$$n$$$ domino cards, and the $$$i$$$-th of these cards has two numbers written on it: $$$A_i$$$ on the front side, and $$$B_i$$$ on the back side.
You should pick $$$K$$$ cards from them, then you can get the score of the sum of the numbers written on the front of the $$$K$$$ cards.
After that, you have to choose $$$L$$$ cards from the cards you picked up and you can get the score of the sum of the numbers written on the back of the $$$L$$$ cards.
Now you need to tell Yolo the highest score you can get.
The first line contains an integer $$$n\ (1 \leq n \leq 10^5)$$$.
The second line contains $$$N$$$ integers $$$A_1, A_2, ..., A_N\ (1 \leq A_i \leq 10^9)$$$.
The third line contains $$$N$$$ integers $$$B_1, B_2, ..., B_N\ (1 \leq B_i \leq 10^9)$$$.
The fourth line contains two integers $$$K$$$ and $$$L\ (1 \leq L \leq K \leq N)$$$.
Print one line containing an integer, representing the highest score possible.
5 9 7 2 2 9 5 2 2 3 1 2 1
23
5 9 7 2 2 9 5 9 2 3 1 2 1
25
Name |
---|