#include #define ll long long using namespace std; int N, M, K; int A[200096], B[200096]; int main() { freopen("dodgeball2.in", "r", stdin); freopen("dodgeball2.out", "w", stdout); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> N >> M >> K; priority_queue > H; ll sol = 0; for(int i = 1; i <= N; i++) { cin >> A[i]; sol += A[i]; H.push({-A[i], i}); } for(int i = 1; i <= N; i++) { cin >> B[i]; sol += B[i]; H.push({-B[i], -i}); } while(H.size()) { pair temp = H.top(); H.pop(); if(temp.second > 0) { sol += (M < N) * temp.first; M++; } else if((temp.second < 0)) { sol += (K < N) * temp.first; K++; } } cout << sol << '\n'; return 0; }