#include #include #include #include #include using namespace std; typedef complex POS; typedef pair LINE; POS TABLE[32][32]; int N; POS CrossPoint(const LINE& l1, const LINE& l2) { POS p1 = l1.first; POS p2 = l1.second; POS p3 = l2.first; POS p4 = l2.second; POS rot = polar(1.0, 1.0); p1 *= rot; p2 *= rot; p3 *= rot; p4 *= rot; double a1, b1, a2, b2; { double x1 = p1.real(); double y1 = p1.imag(); double x2 = p2.real(); double y2 = p2.imag(); a1 = (y2 - y1) / (x2 - x1); b1 = y1 - a1 * x1; } { double x1 = p3.real(); double y1 = p3.imag(); double x2 = p4.real(); double y2 = p4.imag(); a2 = (y2 - y1) / (x2 - x1); b2 = y1 - a2 * x1; } double x = (b2 - b1) / (a1 - a2); double y = a1 * x + b1; POS res(x, y); res /= rot; return res; } double CalcArea(const vector& v) { double res = 0.0; for (int i = 0; i < (int)v.size() - 1; ++i){ res += v[i].real() * v[i + 1].imag() - v[i].imag() * v[i + 1].real(); } res /= 2.0; return res; } double Calc(int x, int y) { vector v; v.push_back(TABLE[x][y]); v.push_back(TABLE[x + 1][y]); v.push_back(TABLE[x + 1][y + 1]); v.push_back(TABLE[x][y + 1]); v.push_back(TABLE[x][y]); return CalcArea(v); } void Input() { int n = N; TABLE[0][0] = POS(0, 0); TABLE[0][n + 1] = POS(0, 1); TABLE[n + 1][0] = POS(1, 0); TABLE[n + 1][n + 1] = POS(1, 1); for (int i = 1; i <= n; ++i){ double a; cin >> a; TABLE[i][0] = POS(a, 0); } for (int i = 1; i <= n; ++i){ double b; cin >> b; TABLE[i][n + 1] = POS(b, 1); } for (int i = 1; i <= n; ++i){ double c; cin >> c; TABLE[0][i] = POS(0, c); } for (int i = 1; i <= n; ++i){ double d; cin >> d; TABLE[n + 1][i] = POS(1, d); } } void FillCrossPoint() { int n = N; for (int x = 1; x <= N; ++x){ for (int y = 1; y <= N; ++y){ LINE l1 = make_pair(TABLE[x][0], TABLE[x][n + 1]); LINE l2 = make_pair(TABLE[0][y], TABLE[n + 1][y]); TABLE[x][y] = CrossPoint(l1, l2); } } } main() { while (cin >> N && N){ Input(); FillCrossPoint(); double answer = -1.0; for (int x = 0; x <= N; ++x){ for (int y = 0; y <= N; ++y){ answer = max(answer, Calc(x, y)); } } printf("%.06lf\n", answer); } }