Light and Shadow

Time Limit: 1000ms
Memory Limit: 32768KB
This problem will be judged on HDU. Original ID: 3867
64-bit integer IO format: %I64d      Java class name: Main

Description


A nuclear explosion happened and how many sticks on the ground will be illuminated by the radiation? You can assume that the ground is flat, and no radiation can go through the sticks, and any two sticks have no intersections.
To simplify the problem, no two endpoints located on the path of a single radiation.

Input

For each case, the first line contains the number of sticks n(1~10,000), until the end of file.

The second line includes (sx, sy) to denote the position of explosion center.

Then following n lines are the sticks expressed in (ax, ay) and (bx, by).

Output

For each case, print the number of sticks which would be illuminated.

Sample Input

6
0.5 0.5
1.0 -1.0 1.0 1.0
1.5 1.0 1.5 -1.0
2.0 -1.0 2.0 1.0
-1.0 -1.0 -1.0 1.0
-1.5 1.0 -1.5 -1.0
-2.0 -1.0 -2.0 1.0

Sample Output

2

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .