By Kay Akashi
Tokyo is a wonderland of gastronomy.
There're sushi places and ramen places in one area of Tokyo. -th sushi place costs you yen () and -th ramen place costs you yen () (note: yen is a Japanese currency).
You decided to go to one sushi restaurant for lunch and one ramen restaurant for dinner. Given an integer (), output the -th biggest price you're going to spend in total. More formally, output the -th greatest value of where and .
. .
.
.
The first line of input contains integers, , , and . The second line of input contains integers, , , …, . The third line of input contains integers, , , …, .
Output a single integer, the -th biggest total price of sushi lunch and ramen dinner.
3 3 5
1200 1500 1000
800 1100 1700
2300
From the most expensive to cheapest, possible combined prices are as follows: . The -th most expensive combination is yen.
7 5 12
1234 2342 8255 9273 1400 988 1482
3002 2351 1925 1351 1000
4693