#include<iostream>
#include<vector>
#include<stdio.h>
using namespace std;

static const int INFTY = 20001;

double w[510][510];
double e[510][510];
int root[510][510];

int main(){

    int n;
    double P, Q, t; //グローバル変数にする必要がある
    vector<double> p, q;
    
    //入力処理
    cin >> n;
    p.push_back(0);
    for(int i=0; i<n; i++){
        cin >> P;
        p.push_back(P); 
    }
    for(int i=0; i<n+1; i++){
        cin >> Q;
        q.push_back(Q);
    }

    for(int i=1; i<=n+1; i++){
        e[i][i-1] = q[i-1];
        w[i][i-1] = q[i-1];
    }
    for(int l=1; l<=n; l++){
        for(int i=1; i<=n-l+1; i++){
            int j = i + l - 1;
            e[i][j] = 20001;
            w[i][j] = w[i][j-1] + p[j] + q[j];
            for(int k=i; k<=j; k++){
                t = e[i][k-1] + e[k+1][j] + w[i][j];    //期待値
                if(t < e[i][j]){    //最小値を探す
                    e[i][j] = t;
                    root[i][j] = k;
                }
            }
        }
    }
    printf("%.8lf\n", e[1][n]);
    return 0;
}
