#include #include #include using namespace std; using ll=long long; #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() template bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;} template bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;} const int M=3'000; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int na,nb,nc; cin>>na>>nb>>nc; vectorA(na),B(nb),C(nc); vectorSA(2*M+1),SB(2*M+1),SC(2*M+1); for(int i=0;i>A[i]; SA[A[i]+M]++; } vectorXA(2*M+1); XA[2*M]=M*SA[2*M]; for(int i=2*M-1;i>=0;i--){ XA[i]=XA[i+1]+(i-M)*SA[i]; SA[i]+=SA[i+1]; } for(int i=0;i>B[i]; SB[B[i]+M]++; } for(int i=0;i>C[i]; SC[C[i]+M]++; } ll ans=0,cnt_b=0,sum_b=0; for(int j=2*M;j>=-1;j--){ ll cnt_c=0,sum_c=0; for(int k=2*M;k>=-1;k--){ int ok=2*M,ng=-1; while(ok-ng>1){ int mid=(ok+ng)/2; if((mid-M)*cnt_b+sum_c>=0)ok=mid; else ng=mid; } if(ok*cnt_b+sum_c<0){ chmax(ans,sum_b*cnt_c); }else{ chmax(ans,XA[ok]*cnt_b+sum_b*cnt_c+sum_c*SA[ok]); } if(k>=0){ cnt_c+=SC[k]; sum_c+=(ll)(k-M)*SC[k]; } } if(j>=0){ cnt_b+=SB[j]; sum_b+=(ll)(j-M)*SB[j]; } } cout<