#include <iostream>
#include <cstdio>
#define N 105
#define M 40005
using namespace std;

int n, a[M], t[M], v[N];
double s;
int main()
{
	int i, j;
	cin >> n;
	for (i = 1; i <= n; i++) scanf("%d", &t[i]), t[i] *= 2, t[i] += t[i - 1];
	for (i = 1; i < t[n]; i++) a[i] = 1e9;
	t[n + 1] = t[n];
	for (i = 1; i <= n; i++) scanf("%d", &v[i]), v[i] *= 2;
	for (i = j = 1; i <= n; i++)
		for (; j <= t[i]; j++) a[j] = min(a[j], min(v[i], a[j - 1] + 1));
	for (i = n + 1, j = t[n] - 1; i > 0; i--)
		for (; j >= t[i - 1]; j--) a[j] = min(a[j], min(v[i], a[j + 1] + 1));
	for (i = 0; i <= t[n]; i++) s += a[i];
	printf("%.6f", s / 4);
    return 0;
}