Stamping Twice

Given a convex polygon and its translation by a vector, find the total perimeter of the union of the two copies.

Medium7GeometryImplementationNo attempts yetTime limit1sMemory limit128 MB

Problem

When the organizers posted the qualifying round standings, one contestant walked up and asked: "Where is the stamp?"

To avoid that question this time, the standings get stamped twice instead of once. The stamp has the shape of a convex polygon, and the two imprints may overlap or lie apart. Compute the total perimeter of the inked part of the paper.

The second imprint is the first one translated by the vector (Dx,Dy)(D_x, D_y).

Input

The first line contains the number of vertices of the stamp, NN (3N1000003 \le N \le 100\,000).

Each of the next NN lines contains the coordinates xx, yy (0x,y<1090 \le x, y < 10^9) of a vertex of the first imprint. The vertices are given in clockwise order, and no three of them are collinear.

The last line contains the integers DxD_x, DyD_y (109<Dx,Dy<109-10^9 < D_x, D_y < 10^9) that form the translation vector of the second imprint.

Output

Print the perimeter of the inked part on one line, rounded to two decimal places. Print both decimals even when the value is a whole number, as in 34.00. For example, if the exact value is 12.075412.0754\ldots, print 12.08.

In every input the exact answer is more than 0.0010.001 away from a rounding boundary, so double precision arithmetic gives the same rounded value.

Note

the two imprints overlapping

The picture shows the first example. The red triangle is the first imprint, and the blue triangle is the second one, translated by (1,1)(-1, -1).