Hovering Hornet

Expected number of spots on a die visible from a random point in its box, counting a spot only when the segment to the viewer misses the die.

Medium6GeometryProbabilityMathNo attempts yetTime limit1sMemory limit512 MB

Problem

You have managed to trap a hornet inside a box lying on top of your dining table. Your playing dice is trapped inside as well, so you cannot retrieve it and continue your game of Monopoly without risking the hornet's wrath. Instead, you pass the time by computing the expected number of spots on the dice visible to the hornet.

The hornet, the dice and the box are located in the standard three-dimensional coordinate system, with the xx coordinate growing eastwards, the yy coordinate growing northwards and the zz coordinate growing upwards. The surface of the table is the xyxy plane.

Perspective and birds-eye view of the second example input

The dice is a 1×1×11 \times 1 \times 1 cube resting on the table with the center of its bottom side exactly at the origin, so the coordinates of its two opposite corners are (0.5,0.5,0)(-0.5, -0.5, 0) and (0.5,0.5,1)(0.5, 0.5, 1). The top side of the dice has 55 spots, the south side 11 spot, the east side 33 spots, the north side 66 spots, the west side 44 spots and the bottom side 22 spots. The bottom spots are invisible and irrelevant.

The box is a 5×5×55 \times 5 \times 5 cube also resting on the table, with the dice in its interior. The box is given by the coordinates of its bottom side, a 5×55 \times 5 square.

The hornet hovers at a uniformly random point of the (continuous) space inside the box that is not occupied by the dice. Compute the expected number of spots visible to the hornet. The dice is opaque, so the hornet sees a spot only if the segment connecting the center of that spot to the location of the hornet does not intersect the interior of the dice.

Input

The input consists of 44 lines. The kk-th line contains two floating-point numbers xkx_k and yky_k (5xk,yk5-5 \le x_k, y_k \le 5), the coordinates of the kk-th corner of the bottom side of the box in the xyxy plane. The corners are given in counterclockwise order and they describe a square whose side length is exactly 55.

The box fully contains the dice. The surfaces of the box and the dice neither intersect nor touch, except along the bottom sides.

Output

Print the expected number of visible spots on one line, rounded to six digits after the decimal point. Always print all six digits. For example, if the answer is exactly 11.2511.25, print 11.250000.