Light#4948

Light

3 seconds
32 megabytes
Hard

Santa Claus Petrovich moved to a new hut. It consists of only one room. Its floor has the form of a simple polygon (not necessarily convex) with vertices. It was dark in the hut at first, but then Petrovich hung a lamp at the point with projection (X_0, Y_0).

Which area of the room is illuminated by the lamp?

Input

The first line contains the coordinates of the lamp (X_0, Y_0). You may regard the lamp as a material point. The second line contains the integer 3 \le N \le 50000. In the next lines there are coordinates (X_i, Y_i) of vertices of the -gon. The vertices are given in the counter-clockwise order. All the coordinates are given as pairs of real numbers separated with a space, 0 \le X_i, Y_i \le 1000. The coordinates contain not more than four fractional digits. It is guaranteed that the lamp is strictly inside the room.

Output

Output the area of the illuminated part of the room. The area must be given with accuracy of at least two fractional digits.

Examples

Example 1

Loading
Loading