当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3643:Friend or Foe?

Special Judge 特殊评判
题目描述

Luke has a bit of trouble telling the difference between star systems in the Rebel Alliance and those in the Empire. He has a list of the x, y, z coordinates of each system in the Empire and each in the Alliance, but at warp speed he simply has insufficient time to look up systems in his lists.

After destroying the friendly planet Endor, Luke has had to admit he needs the help of his targeting computer. His computer, being an early model, can only compute the truth value of the inequality

   ax + by + cz + d > 0

Where x, y, z are the coordinates of the system, and a,b,c,d are real-valued coefficients. You are to compute a, b, c, d so that the inequality holds for all systems in the Empire, and for no systems in the Alliance.

输入解释

Input consists of several test cases followed by -1 -1. Each test case first gives the number of Alliance systems, followed by a line for each system giving the integer coordinates -100 ≤ x, y, z ≤ 100 of the system in 3-dimensional space. The number of Empire systems, and the coordinates of each, follow. The Empire and Alliance combined have at least one and no more than 200 systems. All systems have distinct coordinates.

输出解释

For each test case, output a single line containing a, b, c, d as real numbers separated by spaces. Use enough precision to ensure that your solution is correct. You may assume that a solution exists; if there is more than one solution, any one will do.

输入样例
2
-93 48 -92
-62 12 -32
8
51 98 -61
-3 72 81
95 25 22
89 43 -99
100 -2 -96
-18 45 -63
36 -21 -8
71 -24 42
-1 -1
输出样例
83.000000 65.000000 -27.000000 -62.000000

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3643

最后修改于 2020-10-29T07:06:48+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536