POJ3528最大化最小值+三维凸包

来源:互联网 发布:cdr软件图标 编辑:程序博客网 时间:2024/06/08 04:32

Ultimate Weapon

Time Limit: 2000MS Memory Limit: 131072K
Total Submissions: 2348 Accepted: 1135
Description

In year 2008 of the Cosmic Calendar, the Aliens send a huge armada towards the Earth seeking after conquest. The humans now depend on their ultimate weapon to retain their last hope of survival. The weapon, while capable of creating a continuous, closed and convex lethal region in the space and annihilating everything enclosed within, unfortunately exhausts upon each launch a tremendous amount of energy which is proportional to the surface area of the lethal region.

Given the positions of all battleships in the Aliens’ armada, your task is to calculate the minimum amount of energy required to destroy the armada with a single launch of the ultimate weapon. You need to report the surface area of the lethal region only.

Input

The first line contains one number N – the number of battleships.(1 ≤ N ≤ 500)
Following N lines each contains three integers presenting the position of one battleship.

Output

The minimal area rounded to three decimal places.

Sample Input

4
0 0 0
4 0 0
2 3 0
1 1 2
Sample Output

19.137
Hint

There are no four coplaner battleships.
Source

POJ Founder Monthly Contest – 2008.03.16, Jiang Liyang
在2008年的宇宙日历中,外星人向地球发送了一个巨大的无敌舰队。人类现在依靠他们的终极武器来维持生存的最后希望。武器,虽然能够在空间中创造一个连续的、封闭的和凸的致命区域,并消灭所有包围在里面的东西,但不幸的是,每一次发射都消耗了大量的能量,与致命区域的表面积成正比。
考虑到外星人无敌舰队的所有战列舰的位置,你的任务是计算出摧毁无敌舰队所需的最低能量。你只需要报告致命区域的表面积。
输入
第一行包含一个数字N——战列舰的数量。(1≤N≤500)
在N行之后,每个包含三个整数表示一个战舰的位置。
c++

原创粉丝点击