Fortune Telling π
Given a collection of n cards. The i-th card (1 β€ i β€ n) has a number Ai on its front and a number Bi on its back. At the start, all the cards are facing upwards. He wants to minimize the range of numbers (i.e. the difference between the maximum and minimum values) on the face-up side. He is allowed to flip a maximum of m cards. Flipping a card will transition Bi to the face up side and Ai to the back. Help him find the minimum possible range after using at most m flips.
Input
The first line of the input consists of 2 integers n and m. The next line contains n integers, i-th of which denotes Ai. The next line contains n integers, i-th of which denotes Bi.
Output
Output a single integer, the minimum possible range.
1Example 1
Constraints
Limits and guarantees your solution can rely on.