#include<iostream>
#include<algorithm>
#include<vector>
#include<tuple>
#define TT std::tuple<double,double,double>
double t[210];
double v[210];
std::vector<TT> D;
double ans;
int SE;
int main() {
	int N;
	std::cin >> N;
	D.push_back(TT{ 0,0,0 });
	for (int i = 1; i <= N; i++) {
		std::cin >> t[i];
		t[i] += t[i - 1];
	}
	for (int i = 1; i <= N; i++) {
		std::cin >> v[i];
		D.push_back(TT{ t[i - 1],t[i],v[i] });
	}
	D.push_back(TT{ t[N],t[N],0 });
	double bef = 0;
	for (double i = 0.5; i <= t[N]; i+=0.5) {
		double ms = bef + 0.5;
		for (auto u : D) {
			double a, b, c;
			std::tie(a, b, c) = u;
			if (b <= i) {
				ms = std::min(ms, c + i - b);
			}
			if (a <= i&&i <= b) {
				ms = std::min(ms, c);
			}
			if (i <= a) {
				ms = std::min(ms, c + a - i);
			}
		}
		ans += (bef + ms)*0.25;

		bef = ms;
	}
	std::cout << std::fixed << ans << std::endl;
	return 0;
}