// g++-13 1.cpp -std=c++17 -O2 -I . #include using namespace std; #include #include using namespace atcoder; using ll = long long; using ld = long double; using vi = vector; using vvi = vector; using vll = vector; using vvll = vector; using vld = vector; using vvld = vector; using vst = vector; using vvst = vector; #define fi first #define se second #define pb push_back #define eb emplace_back #define pq_big(T) priority_queue,less> #define pq_small(T) priority_queue,greater> #define all(a) a.begin(),a.end() #define rep(i,start,end) for(ll i=start;i<(ll)(end);i++) #define per(i,start,end) for(ll i=start;i>=(ll)(end);i--) #define uniq(a) sort(all(a));a.erase(unique(all(a)),a.end()) int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int na,nb,nc;cin>>na>>nb>>nc; vvi cnt(3,vi(7000,0)); rep(i,0,na){ int x;cin>>x; cnt[0][x+3500]++; } rep(i,0,nb){ int x;cin>>x; cnt[1][x+3500]++; } rep(i,0,nc){ int x;cin>>x; cnt[2][x+3500]++; } vector>> v(3,vector>(7000,{0,0})); per(i,6998,0){ rep(j,0,3){ v[j][i]=v[j][i+1]; v[j][i].first+=(ll)cnt[j][i]*(i-3500); v[j][i].second+=cnt[j][i]; } } ll ans=0; rep(i,0,7000){ rep(j,0,7000){ // A_i >= - sum(C_i) / |S_B| auto [sumb,cntb]=v[1][i]; auto [sumc,cntc]=v[2][j]; if(cntb==0){ ans=max(ans,na*sumc); continue; } ll need=(-sumc+cntb-1)/cntb; need+=3500; if(need<0)need=0; if(6999<=need)need=6999; rep(k,need-2,need+2){ if(k<0||7000<=k)continue; auto [suma,cnta]=v[0][k]; ans=max(ans,suma*cntb+sumb*cntc+sumc*cnta); } } } cout<