Problem A
The Biggest Triangle
Three infinite lines define a triangle, unless they meet at a common point or some of them are parallel.
![\includegraphics[width=0.8\textwidth ]{triangles.pdf}](/problems/biggesttriangle/file/statement/en/img-0001.png)
Given a collection of infinite lines, what is the largest possible perimeter of a triangle defined by some three lines in the collection?
Input
The first line of input contains a single integer
The next
Output
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
If no triangle can be formed using the given lines, then you should instead display the message no triangle.
Sample Input 1 | Sample Output 1 |
---|---|
3 0 0 0 1 0 0 1 0 0 1 1 0 |
3.4142135624 |
Sample Input 2 | Sample Output 2 |
---|---|
3 0 0 0 1 0 0 1 0 0 0 1 1 |
no triangle |
Sample Input 3 | Sample Output 3 |
---|---|
4 0 0 0 1 0 4 3 0 0 0 1 0 -1 -1 1 1 |
12.0000000000 |