Headquarters is picking agents for a secret mission. The n candidates who fit the mission are already chosen. Every candidate is excellent in every respect, but there is one problem. They talk too much.
To deal with that, the supervisor lines up all n candidates and assigns each one a talkativeness ai. The supervisor then performs at most s operations. Each operation picks two adjacent candidates and swaps their places. Once every operation is done, the first k candidates in the line are taken as agents.
The supervisor wants the sum of the talkativeness values of those k agents to be as small as possible. Find the smallest sum the supervisor can reach.
The first line contains three natural numbers n, k, s separated by spaces. (1≤k≤n≤150, 1≤s≤109)
The second line contains n integers a1,a2,…,an separated by spaces, the talkativeness of each candidate. (1≤ai≤106)
Print the smallest possible sum of the talkativeness values of the first k candidates.
In the first example, swap the 2nd candidate with the 3rd candidate once.
In the second example, swap the 3rd with the 4th, then swap the 4th with the 5th. That is 2 operations.
In the third example, swap the 1st with the 2nd, then the 3rd with the 4th, then the 2nd with the 3rd. That is 3 operations.