#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
 
#define pb push_back
 
int main(){
    while(1){
        ll n,p,j;
        ll sum = 0 , cnt[1002] = {};
        scanf("%lld",&n);
        if(n == 0)break;
        for(int i = 0 ; i < n ; i ++){
            scanf("%lld",&p);
            sum += p;
        }
        for(int i = 0 ; i < n-1 ; i ++){
            scanf("%lld",&j);
            sum += j;
            cnt[j] ++;
        }
        ll ret = sum , num = 1 , t = 0;
        while(num < n){
            while(cnt[t] == 0)t ++;
            sum -= t;
            num ++;
            cnt[t] --;
            ret = max ( ret , sum*num );
        }
        printf("%lld\n",ret);
    }
}