#include <iostream>
#include <cstdio>
using namespace std;
int n, s, mv, to, t[105], v[105], z[40005];
int main() {
	int i, j=0;
	cin>>n;
	for(i=1; i<=n; i++) cin>>t[i], t[i]*=2;
	for(i=1; i<=n; i++) cin>>v[i], v[i]*=2;
	for(i=1; i<=n; i++) {
		to += t[i];
		z[j] = min(z[j], v[i]);
		for(++j; j<=to; j++) z[j] = min(z[j-1]+1, v[i]);
		j--;
	}
	for(i=j-1; i; i--) s += mv = min(z[i], mv+1);
	printf("%.9f\n", s/4.0);
	return 0;
}
