In the International City of Pipe Construction, it is planned to repair the water pipe at a certain point in the water pipe network. The network consists of water pipe segments, stop valves and source point. A water pipe is represented by a segment on a 2D-plane and intersected pair of water pipe segments are connected at the intersection point. A stop valve, which prevents from water flowing into the repairing point while repairing, is represented by a point on some water pipe segment. In the network, just one source point exists and water is supplied to the network from this point.

Of course, while repairing, we have to stop water supply in some areas, but, in order to reduce the risk of riots, the length of water pipes stopping water supply must be minimized. What you have to do is to write a program to minimize the length of water pipes needed to stop water supply when the coordinates of end points of water pipe segments, stop valves, source point and repairing point are given.

A data set has the following format:

NM

x_{s1}y_{s1}x_{d1}y_{d1}

...

x_{sN}y_{sN}x_{dN}y_{dN}

x_{v1}y_{v1}

...

x_{vM}y_{vM}

x_{b}y_{b}

x_{c}y_{c}

The first line of the input contains two integers, `N` (`1 ≤ N ≤ 300`) and `M` (`0 ≤ M ≤ 1,000`) that indicate the number of water pipe segments and stop valves.
The following `N` lines describe the end points of water pipe segments.
The `i`-th line contains four integers, `x _{si}`,

You may assume that any absolute values of coordinate integers are less than 1,000 (inclusive.) You may also assume each of the stop valves, the source point and the repairing point is always on one of water pipe segments and that that each pair among the stop valves, the source point and the repairing point are different. And, there is not more than one intersection between each pair of water pipe segments. Finally, the water pipe network is connected, that is, all the water pipes are received water supply initially.

Print the minimal length of water pipes needed to stop water supply in a line.
The absolute or relative error should be less than or `10 ^{-6}`.
When you cannot stop water supply to the repairing point even though you close all stop valves, print "

`-1`

" in a line.
1 2 0 0 10 0 1 0 9 0 0 0 5 0

9.0

5 3 0 4 2 4 0 2 2 2 0 0 2 0 0 0 0 4 2 0 2 4 0 2 1 0 2 2 1 4 2 1

3.0

2 1 0 0 0 4 0 2 2 2 1 2 0 1 0 3

-1

Source: ACM-ICPC Japan Alumni Group Summer Camp
, Day 4, Tokyo, Japan, 2012-09-17

http://acm-icpc.aitea.net/

http://acm-icpc.aitea.net/