#P2287. [HNOI2004] 最佳包裹

    ID: 1258 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>动态规划,dp递推2004各省省选湖南凸包

[HNOI2004] 最佳包裹

Description

Faqiang Company produces a kind of metal product made by connecting several straight metal bars, which are welded together at their intersection points. For aesthetic reasons, the product is to be wrapped with a layer of special material. To save costs, the company hopes to use the least amount of material (the waste from cutting scraps is ignored).

Write a program that, given the number of vertices of the product and the coordinates of all vertices, computes the minimal area of material needed to wrap the product. The result should be rounded to six decimal places.

Input Format

The input file consists of (n+1)(n+1) lines.

The first line contains an integer nn (4n1004 \leq n \leq 100), denoting the number of vertices.

From line 22 to line (n+1)(n+1), the (i+1)(i+1)-th line contains three real numbers xix_i, yiy_i, ziz_i, which are the coordinates of the ii-th vertex.

All vertices are guaranteed to be distinct.

Output Format

Output a single real number, rounded to six decimal places, which is the minimal area of material required to wrap one such product.

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

2.366025

Hint

Translated by ChatGPT 5