Maximum Tent Volume

Assign n poles of given heights to a central hole and n-1 fixed holes around it to maximize the total volume of the resulting triangles.

Hard8GeometryDynamic programmingGreedySortingNo attempts yetTime limit2sMemory limit512 MB

Problem

A circus is putting up its tent. The canvas is held up by nn poles of various lengths. The holes for the poles are already dug at fixed spots on the ground, but you decide which pole goes into which hole.

One hole is at the origin and takes the central pole. The other n1n-1 holes lie around the origin. Take two outer poles that are adjacent in the order of their angle around the origin, together with the central pole: the canvas over those three tops is pulled tight into one flat triangle. Only the space under these triangles counts as volume, and the volume under one triangle is the space trapped between the triangle drawn on the ground and the piece of canvas above it.

Assign the poles to the holes so that the total volume under the tent is as large as possible, and report that volume.

Input

The first line contains an integer nn (3n303 \le n \le 30), the number of poles.

Each of the next n1n-1 lines contains two integers xx and yy (1000x,y1000-1000 \le x, y \le 1000), one hole position on the ground. These lines are not sorted by angle around the origin.

Each of the next nn lines contains one integer hh (1h1001 \le h \le 100), the length of one pole.

One pole goes into the hole at the origin, and the remaining n1n-1 poles go into the listed positions, one pole per hole. The listed positions surround the origin: the polygon whose vertices are those positions, taken in order of angle around the origin, contains the origin strictly inside. No two positions have the same angle at the origin, so no canvas triangle has area 0.

Output

Print the largest total volume under the tent, rounded to exactly two decimal places. The exact answer is always a multiple of 16\frac{1}{6} and never falls exactly halfway between two two-decimal values, so the rounded number is unique.