#include <iostream>
#include <cfloat>

double min(double x, double y)
{
	return x>y ? y : x;
}

int main()
{
	std::string strn; getline(std::cin, strn);
	int n = std::stoi(strn);
	
	double *p = new double[n];
	double *q = new double[n+1];
	
	for (int i=0; i<n; i++) std::cin >> p[i];  // p[0], p[1], ... , p[n-1]
	for (int i=0; i<=n; i++) std::cin >> q[i]; // q[0], q[1], ... , q[n-1], q[n]
	
	double *cost_sum = new double[n+1];
	cost_sum[0] = q[0];
	for (int i=1; i<n+1; i++) cost_sum[i] = cost_sum[i-1] + p[i-1] + q[i]; 
	
	double** DP = new double*[n+1];
	for (int i=0; i<n+1; i++) DP[i] = new double[n];
	
	for (int j=0; j<n; j++) DP[j+1][j] = 0.0;
	
	for (int d=0; d<n; d++) {
		for (int i=0; i<n-d; i++) {
			if (d==0) DP[i][i] = q[i] + q[i+1];
			else {
				DP[i][i+d] = DBL_MAX;
				for (int j=0; j<=d; j++) {
					double left_cost_sum  = cost_sum[i+j] - cost_sum[i] + q[i];
					double right_cost_sum = cost_sum[i+d+1] - cost_sum[i+j+1] + q[i+j+1];
					DP[i][i+d] = min(DP[i][i+d], DP[i][i+j-1] + left_cost_sum + DP[i+j+1][i+d] + right_cost_sum);
				}
			}
			// std::cout << "DP[" << i << "][" << i+d << "] = " << DP[i][i+d] << std::endl;
		}
	}
	
	std::cout << std::fixed << DP[0][n-1] + 1 << std::endl;
	
	for (int i=0; i<n; i++) delete[] DP[i];
	delete[] DP;
	delete[] cost_sum;
	delete[] p;
	delete[] q;
	
	return 0;
}

