PivotOJ

The Biggest Triangle

시간 제한: 3000ms메모리 제한: 512MB출처: ICPC Rocky Mountain Regional 2019BOJ 17881

문제

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".

예제

예제 1

입력
3
0 0 0 1
0 0 1 0
0 1 1 0
출력
3.4142135624

예제 2

입력
3
0 0 0 1
0 0 1 0
0 0 1 1
출력
no triangle

예제 3

입력
4
0 0 0 1
0 4 3 0
0 0 1 0
-1 -1 1 1
출력
12.0000000000
코드를 제출하려면 로그인하세요.