A rapper is producing a special vinyl edition of his album. Every record must first be pressed at a pressing plant, and only then coated with glitter at a glitter shop before it is finished.
The rapper has a contract to make exactly k records. The pressing plant and the glitter shop can each handle only one record per day. Every record must be pressed before it is glittered, but the same record may be both pressed and glittered on a single day. A record that has been pressed but not yet glittered can be stored for as long as needed at no extra cost.
For each of the next n days you are given that day's pressing cost and glittering cost. Decide on which days to press and on which days to glitter so that all k records are finished at the minimum possible total cost.
The first line contains two integers n and k (1≤k≤n≤5×105).
The second line contains n positive integers, each at most 109; the i-th value is the pressing cost on day i.
The third line contains n positive integers, each at most 109; the i-th value is the glittering cost on day i.
Print a single integer: the minimum total cost to produce k glitter-coated records.
For the sample input, one optimal plan is: press and glitter the first record on day 1; press the second record on day 2 and glitter it on day 4; press the third record on day 3 and glitter it on day 5; press the fourth record on day 6 and glitter it on day 8. The total cost is 32.