Candles
InterviewTime limit2sMemory limit1024 MB
Given n candle points inside a circle and m lines that cut the cake, decide whether some region bounded by the lines contains two or more candles.
- Level
Medium5 of 10
- Topics
- Geometry, Hash map, Sorting, Implementation
- Solved
- No attempts yet
Problem
Misha has turned years old. The birthday cake baked for the occasion is a circle of radius centered at the origin. There are candles on the cake. Misha's mother divided the cake into pieces by making straight cuts. Each guest took one of the resulting pieces.

Misha wants to know whether any of his guests ended up with more than one candle. Help him find out.
Input
The first line of the input file contains the integers , , and (, , ).
The following lines contain pairs of integers , the coordinates of the points where the candles are placed. These points lie inside the circle, and the size of the candles can be ignored. No two candles coincide.
The last lines describe the cuts, each with three integers . Such a triple corresponds to the cut given by the equation . No cut passes through a candle. No two cuts coincide. The values of do not exceed in absolute value.
Output
If one of the guests got more than one candle, output the word <<YES>> to the output file, otherwise output the word <<NO>>.