F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Light and Shadow

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 862    Accepted Submission(s): 249


Problem 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
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-26 20:38:07, Gzip enabled