PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GD0000044. Hai dãy và các phép đổi chỗ (Two Arrays And Swaps)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Hai dãy và các phép đổi chỗ (Two Arrays And Swaps)

Two Arrays And Swaps

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Two positive-integer arrays aa and bb have length nn. In one move, swap any aia_i and bjb_j (possibly with different indices). Perform at most kk moves and maximize the sum of aa.

Input

Line 1: n,kn,k. Line 2: nn elements aia_i. Line 3: nn elements bib_i.

Output

Print the maximum possible sum of aa.

Subtasks

  • Subtask 1 (20 points): 1≤n≤31\le n\le 3; 0≤k≤n0\le k\le n; 1≤ai,bi≤301\le a_i,b_i\le 30 for every ii.
  • Subtask 2 (30 points): 1≤n≤121\le n\le 12; 0≤k≤n0\le k\le n; 1≤ai,bi≤301\le a_i,b_i\le 30 for every ii.
  • Subtask 3 (50 points): 1≤n≤301\le n\le 30; 0≤k≤n0\le k\le n; 1≤ai,bi≤301\le a_i,b_i\le 30 for every ii.

Examples

Input

5 3
1 2 3 4 5
10 9 10 10 9

Output

39

Explanation

Replace the three smallest elements 1, 2, 3 with three 10s from bb. The resulting sum is 10+10+10+4+5=3910+10+10+4+5=39.