시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
3 초 | 512 MB | 26 | 12 | 8 | 40.000% |
Three infinite lines define a triangle, unless they meet at a common point or some of them are parallel.
Given a collection of infinite lines, what is the largest possible perimeter of a triangle defined by some three lines in the collection?
The first line of input contains a single integer n (3 ≤ n ≤ 100) indicating the number of infinite lines.
The next n lines describe the collection of infinite lines. The ith such line contains four integers x1, y1, x2, y2 (−10 000 ≤ x1, y1, x2, y2 ≤ 10 000) where (x1, y1) ≠ (x2, y2) are two points lying on the ith infinite line.
Display a single real value which is the perimeter of the largest triangle that can be formed from three of the infinite lines. Your output will be considered correct if it is within an absolute or relative error of 10−5 of the correct answer.
If no triangle can be formed using the given lines, then you should instead display the message "no triangle".
3 0 0 0 1 0 0 1 0 0 1 1 0
3.4142135624
3 0 0 0 1 0 0 1 0 0 0 1 1
no triangle
4 0 0 0 1 0 4 3 0 0 0 1 0 -1 -1 1 1
12.0000000000