Time Limit: 2 Seconds
Memory Limit: 65536 KB
On the circuit board, there are lots of circuit paths. We know the basic constrain
is that no two path cross each other, for otherwise the board will be burned.
Now given a circuit diagram, your task is to lookup if there are some crossed
paths. If not find, print "ok!", otherwise "burned!" in
A circuit path is defined as a line segment on a plane with two endpoints p1(x1,y1)
You may assume that no two paths will cross each other at any of their endpoints.
The input consists of several test cases. For each case, the first line contains
an integer n(<=2000), the number of paths, then followed by n lines each
with four float numbers x1, y1, x2, y2.
If there are two paths crossing each other, output "burned!" in one
line; otherwise output "ok!" in one line.
0 0 1 1
0 0 1 1
0 1 1 0
Author: ZHOU, Feng
Source: ZOJ Monthly, September 2003