Codeforces Round 296 (Div. 1)
E
Triangles 3000
Codeforces
3100
原题
← D→
翻译中…

You are given a set $*L* = {*l*_{1}, *l*_{2}, ..., *l*_{*n*}}$ of $*n*$ pairwise non-parallel lines on the Euclidean plane. The $*i*$-th line is given by an equation in the form of $*a*_{*i*}*x* + *b*_{*i*}*y* = *c*_{*i*}$. $*L*$ doesn't contain three lines coming through the same point.

翻译中…

A subset of three distinct lines is chosen equiprobably. Determine the expected value of the area of the triangle formed by the three lines.

翻译中…

Input

翻译中…

The first line of the input contains integer $*n*$ ($3 ≤ *n* ≤ 3000$).

翻译中…

Each of the next lines contains three integers $*a*_{*i*}, *b*_{*i*}, *c*_{*i*}$ ($- 100 ≤ *a*_{*i*}, *b*_{*i*} ≤ 100$, $*a*_{*i*}^{2} + *b*_{*i*}^{2} > 0$, $- 10 000 ≤ *c*_{*i*} ≤ 10 000$) — the coefficients defining the $*i*$-th line.

翻译中…

It is guaranteed that no two lines are parallel. Besides, any two lines intersect at angle at least $10^{ - 4}$ radians.

翻译中…

If we assume that $*I*$ is a set of points of pairwise intersection of the lines (i. e. image), then for any point image it is true that the coordinates of $*a*$ do not exceed $10^{6}$ by their absolute values. Also, for any two distinct points image the distance between $*a*$ and $*b*$ is no less than $10^{ - 5}$.

翻译中…

Output

翻译中…

Print a single real number equal to the sought expected value. Your answer will be checked with the absolute or relative error $10^{ - 4}$.

翻译中…

Note

翻译中…

A sample from the statement is shown below. There are four triangles on the plane, their areas are $0.25, 0.5, 2, 2.25$.

翻译中…

image

翻译中…

样例

Input #1
4
1 0 0
0 1 0
1 1 2
-1 1 -1
Output #1
1.25
InputCopy OutputCopy
题目信息
题号
528E
时间限制
5 s
内存限制
512 MB
标签
计算几何
排序

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。