P26471 [AtCoder] The Plane Reflecting the Convex Hull
NOI
题目描述

Problem Description

There are $ N $ points in a 3-dimensional space, where the coordinates of the $ i $-th point are $ (x_i, y_i, z_i) $.

First, you freely choose a 3-dimensional vector $ v $ with a length of $ 1 $.

Next, let the plane $ F $ be the plane passing through the origin and perpendicular to $ v $.

Let $ p_i $ be the foot of the perpendicular from $ (x_i, y_i, z_i) $ to $ F $.

Create a convex hull with vertices $ p_1, p_2, ..., p_N $ on plane $ F $, and let its area be $ S $.

Find the maximum value of the area $ S $, and further, determine how many ways there are to choose the vector $ v $ to maximize $ S $, modulo $ 10^9 + 7 $.

Input Format

The input is given from the standard input in the following format:

$ N $ $ x_1 $ $ y_1 $ $ z_1 $ $ x_2 $ $ y_2 $ $ z_2 $ $ : $ $ x_N $ $ y_N $ $ z_N $

Output Format

Output the maximum value of the area $ S $.

Then, output the number of ways to choose the vector $ v $ to maximize $ S $, modulo $ 10^9 + 7 $.

Note that for the maximum value of the area $ S $, an absolute or relative error of less than $ 10^{-8} $ is considered correct.

Sample Input and Output

Sample Input #1

4
0 0 0
1 0 0
0 1 0
0 0 1

Sample Output #1

0.866025403784
2

Sample Input #2

4
0 0 0
0 1 1
1 0 1
1 1 0

Sample Output #2

1.000000000000
6

Sample Input #3

8
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1

Sample Output #3

1.732050807569
8

Sample Input #4

27
0 0 0
0 0 1
0 0 2
0 1 0
0 1 1
0 1 2
0 2 0
0 2 1
0 2 2
1 0 0
1 0 1
1 0 2
1 1 0
1 1 1
1 1 2
1 2 0
1 2 1
1 2 2
2 0 0
2 0 1
2 0 2
2 1 0
2 1 1
2 1 2
2 2 0
2 2 1
2 2 2

Sample Output #4

6.928203230276
8

Sample Input #5

24
2 3 4
2 4 3
3 2 4
3 4 2
4 2 3
4 3 2
2 1 4
2 4 1
1 2 4
1 4 2
4 2 1
4 1 2
2 3 0
2 0 3
3 2 0
3 0 2
0 2 3
0 3 2
2 1 0
2 0 1
1 2 0
1 0 2
0 2 1
0 1 2

Sample Output #5

14.282856857086
24

Notes/Hints

Constraints

  • All inputs are integers.
  • $4 \leq N \leq 60$
  • $0 \leq x_i, y_i, z_i \leq 1,000$
  • All given points have different coordinates.
  • Not all points lie on the same plane.
  • There are at most finitely many ways to choose $ v $ to maximize the area.

Sample Explanation 1

If $v = (1 / \sqrt{3}, 1 / \sqrt{3}, 1 / \sqrt{3})$, the convex hull of the feet of the perpendiculars from each vertex to $ F $ is an equilateral triangle with side length $\sqrt{2}$, and the area at this time is $\sqrt{3} / 2$, which is the maximum. Similarly, if $v = (-1 / \sqrt{3}, -1 / \sqrt{3}, -1 / \sqrt{3})$, the area of the convex hull on $ F $ is also $\sqrt{3} / 2$. There are only these 2 ways to choose $ v $ to achieve this area.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
4 0 0 0 1 0 0 0 1 0 0 0 1
样例输出
0.866025403784 2