#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int Na,Nb,Nc; cin >> Na >> Nb >> Nc; vector A(Na,1),B(Nb,2),C(Nc,3); for(auto &a : A) cin >> a; for(auto &b : B) cin >> b; for(auto &c : C) cin >> c; sort(A.rbegin(),A.rend()); sort(B.rbegin(),B.rend()); sort(C.rbegin(),C.rend()); for(int i=1; i> diff(min(Na,3000)+1,vector(min(Nc,3000))); for(int i=0; i<=min(Na,3000); i++){ for(int k=0; k 3000) break; long long a = 0,b = 0,c = 0; if(i) a = A.at(i-1); if(k) b = B.at(k-1); int l = lower_bound(diff.at(i).begin(),diff.at(i).end(),b)-diff.at(i).begin(); l = min(l,3000-i-k); if(l) c = C.at(l-1); answer = max(answer,a*k+b*l+c*i); } } cout << answer << endl; }