Fishnet
Time limit1sMemory limit128 MB
Threads join opposite sides of a unit square, and the program reports the largest cell area in the net they form.
Problem
A fisherman named Etadokah woke up on a very small island. The night before, a storm had wrecked his ship and washed him onto this uninhabited island. Pieces of the ship lay scattered around him, and among them he found a square wooden frame and one long thread. He has to survive here until someone comes to rescue him.
To catch fish, he cut the long thread into short pieces and strained them between the pegs of the frame to make a fishnet. To tell whether the net catches small fish as well as large ones, he needs to know how big the meshes are.
The frame is a perfect square with four thin edges one meter long: a bottom edge, a top edge, a left edge, and a right edge. Each edge carries pegs, so there are pegs in total. Peg positions are given as coordinates. The th peg on the bottom edge is at , the th peg on the top edge is at , the th peg on the left edge is at , and the th peg on the right edge is at . The long thread is cut into pieces of suitable length. For , one piece is strained between and , and another between and .
The strained threads and the four edges of the frame together form meshes. Write a program that reports the area of the largest one. Assume the thread is long enough to make the whole net and the frame is thin enough that its thickness can be ignored.
Input
The input consists of several subproblems and ends with a line containing a single zero. Each subproblem has the following format.
n
a1 a2 ... an
b1 b2 ... bn
c1 c2 ... cn
d1 d2 ... dn
The integer on the first line is the number of pegs on each edge. The next four lines give , then , then , then , separated by single spaces. is the -coordinate of the th peg on the bottom edge, is the -coordinate of the th peg on the top edge, is the -coordinate of the th peg on the left edge, and is the -coordinate of the th peg on the right edge. Every coordinate is written with 7 digits after the decimal point.
You may assume , , , , and .
Output
For each subproblem, print the area of the largest mesh on its own line, rounded to 6 digits after the decimal point.