The United Federation of Planets is constructing a new starbase in a remote deep-space sector to monitor subspace anomalies and protect nearby colonies. The Starfleet Corps of Engineers seeks to design an efficient defensive energy grid while minimizing dilithium crystal consumption.
The starbase has an irregular convex polygonal hull with vertices (optimal for distributing structural integrity fields in zero gravity). Engineering analysis has shown that the most effective shield configuration employs energy conduits from the central fusion reactor core to nodes along the starbase's outer hull. The structural integrity field generators dictate that the angle between each pair of adjacent energy conduits must have a strictly specified value, which can differ for distinct pairs due to varying hull strengths. To conserve dilithium crystals, the chief engineer must minimize the total length of all energy conduits. The only parameter under the engineer's control is the rotational orientation of the entire conduit array around the reactor core before it is fixed in place. Your task is to determine the minimum possible total length of all energy conduits.

The image shows (left) the conduit configuration as in the input, and (right) after optimal rotation.
The first line contains a single integer (3 \le n \le 30) — the number of vertices of the polygon forming the outer hull of the starbase. The next lines contain the coordinates of the hull vertices. The vertices are listed in counterclockwise order when viewed from galactic north. All coordinates are integers with absolute value at most . The hull is non-degenerate and convex; no three vertices are collinear.
The next line contains the coordinates of the central fusion reactor core (integers), which is strictly inside the hull.
The next line contains a single integer (1 \le k \le 30) — the number of energy conduits to be deployed. The final line describes one possible configuration: for each conduit, a number is given — the angle in degrees (from to ) its direction forms, measured counterclockwise from the positive axis (standard Federation galactic coordinates).
Output a single real number — the minimum total length of all energy conduits after rotation by the optimal angle. The answer must have precision at least 10^{-5}.
The array may be rotated by any angle; it need not be an integer number of degrees.
Example 1