Problem A
Birthday Cake

On his birthday, John’s parents made him a huge birthday
cake! Everyone had a wonderful dinner, and now it’s time to eat
the cake. There are
Formally, the cake is a circle of radius
Input
Input starts with three integers
The next
The next
All candles and lines are distinct. No candle is on a cut
line. No line is completely outside or tangent to the cake. The
input guarantees that the number of cake pieces remains the
same if any cut line is shifted by at most
Output
Output “yes” if John’s cuts successfully divide the cake so that each piece he obtains has exactly one candle on it. Otherwise, output “no”.
Sample Input 1 | Sample Output 1 |
---|---|
4 2 3 0 1 1 0 -1 0 0 -1 -1 1 0 2 1 0 |
yes |
Sample Input 2 | Sample Output 2 |
---|---|
4 3 3 0 1 1 2 -1 2 0 -1 -1 1 -2 -1 -1 2 0 -1 0 |
no |
Sample Input 3 | Sample Output 3 |
---|---|
3 2 3 2 1 0 0 -1 -2 1 1 -2 3 6 12 |
yes |
Sample Input 4 | Sample Output 4 |
---|---|
3 1 2 0 0 -1 1 1 -1 -2 2 1 |
no |