#include<bits/stdc++.h>
using namespace std;

using Lint=long long;
const double INF=1e9;

int main()
{
   int N; cin>>N;
   N++;
   vector<double> p(N-1),q(N);
   for(int i=0;i<N-1;i++) cin>>p[i];
   for(int i=0;i<N;i++) cin>>q[i];

   vector<double> sumP(N),sumQ(N+1);
   for(int i=0;i<N-1;i++) sumP[i+1]=sumP[i]+p[i];
   for(int i=0;i<N;i++) sumQ[i+1]=sumQ[i]+q[i];

   vector<vector<double>> dp(N+1,vector<double>(N+1,INF));
   for(int i=0;i<N;i++) dp[i][i+1]=0;
   for(int len=2;len<=N;len++){
      for(int l=0;l+len<=N;l++){
         int r=l+len;
         for(int m=l+1;m<r;m++){
            double cost=(sumQ[r]-sumQ[l])+(sumP[m-1]-sumP[l])+(sumP[r-1]-sumP[m]);
            dp[l][r]=min(dp[l][r],dp[l][m]+dp[m][r]+cost);
         }
      }
   }
   double ans=dp[0][N];
   ans+=accumulate(p.begin(),p.end(),0.0);
   ans+=accumulate(q.begin(),q.end(),0.0);
   cout<<fixed<<setprecision(10)<<ans<<endl;
   return 0;
}

