import std.stdio, std.string, std.conv, std.algorithm;

void main() {
	int N = readln().chomp().to!(int);
	int [] t = readln().chomp().split().to!(int[]);
	int [] v = readln().chomp().split().to!(int[]);
	v ~= 0;

	long [210][2] dp;
	dp[0][0] = 1;
	foreach(int i; 0..N) {t[i] *= 2; v[i] *= 2;}
	foreach(int i; 1..N) {
		t[i] += t[i-1];
	}
	int s = t[N-1];
	int k = 0;
	foreach(int i; 1..(s+1)) {
		while(t[k] < i) k++;
		foreach(int j; 0..210) dp[i&1][j] = 0;

		int vv = v[k];
		if(t[k] == i) vv = min(vv, v[k+1]);
		foreach(int j; 0..(vv+1)) {
			if(dp[1^i&1][j] != 0)
				dp[i&1][j] = max(dp[i&1][j], dp[1^i&1][j] + j*2);
			if(dp[1^i&1][j+1] != 0)
				dp[i&1][j] = max(dp[i&1][j], dp[1^i&1][j+1] + j*2+1);
			if(j-1>=0 && dp[1^i&1][j-1] != 0)
				dp[i&1][j] = max(dp[i&1][j], dp[1^i&1][j-1] + j*2-1);
		}
	}
	writeln((dp[s&1][0]-1) / 8.0);
}

