VisaOA #17
Maximize Capped Contribution Sum
估计简单可在线判题
考点(AI 标注)贪心调度
The initial value is Σmin(a[i],b[i]); you may choose at most k distinct positions and change b[i] there to 2b[i]. Find the maximum total.
输入格式
n,k (1≤n≤200000, 0≤k≤n), followed by two lines of n integers each, in the range −10⁹..10⁹ (site-added; negative numbers are allowed).
输出格式
Output the maximum total, using a 64-bit integer.
样例 1
输入:
3 2
10 8 6
3 6 10
输出:
20
样例 2
输入:
2 2
5 5
10 10
输出:
10
样例 3
输入:
2 1
-5 4
3 -3
输出:
-8