1796Circuit Board

1796   Circuit Board

题目描述

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 one line.

A circuit path is defined as a line segment on a plane with two endpoints p1(x1,y1) and p2(x2,y2).

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.

输入样例 复制
1
0 0 1 1

2
0 0 1 1
0 1 1 0
输出样例 复制
ok!
burned!

说明

2
2
通过提交
时空限制2000ms/64mb
题目来源
评测方式在线评测
题目类型
难        度