# 一个有关于浮点数的判断的问题，输入是否可以得到最终的半圆，C语言谢谢

Problem Description
George has K <= 20 steel wires shaped in the form of half-circles, with radii a1, a2, . . . , aK. They can be soldered (connected) at the ends, in any angle. Is it possible for George to make a closed shape out of these wires? He does not have to use all the wires.
The wires can be combined at any angle, but may not intersect. Beware of floating point errors.

Input
Each data set consists of a number 0 < K <= 20 on a line by itself, followed by a line of K space-separated numbers ai. Each number is in the range 0 < ai < 107, and has at most 3 digits after the decimal point.
The input will be terminated by a zero on a line by itself.

Output
For each test case, there should be one word on a line by itself; "YES" if it is possible to make a simple connected figure out of the given arcs, and "NO" if it isn’t.

Sample Input
1
4.000
2
1.000 1.000
3
1.455 2.958 4.424
7
1.230 2.577 3.411 2.968 5.301 4.398 6.777
0

Sample Output
NO
YES
NO
YES

• 写回答

#### 1条回答默认 最新

• threenewbee 2019-11-30 23:36
关注
本回答被题主选为最佳回答 , 对您是否有帮助呢?
评论

#### 悬赏问题

• ¥15 基于RTKLIB框架写的精密单点定位-AR
• ¥15 PFENet的预训练权重
• ¥15 程序哪有错误怎么改？
• ¥15 交换机和交换机之间的链路带宽以及主机带宽的理解
• ¥15 ai创想家对战模式代码
• ¥15 集合A由3个2行4列二维数组构成，从集合A中任意取一个二维数组元素、如果该二维数组元素的对应列位置的上、下两数都是奇数，而且仅有2个列是奇数/奇数，则该数组有意义，并放入集合B中打印输出。
• ¥15 电信IPV6 无法外网访问吗
• ¥15 有偿求效果比较好的遥感影像匹配的c++代码
• ¥15 博主，你好，我下载了你的智能网联汽车辅助驾驶安全信息检测系统，现在不会运行，可以教我吗，
• ¥15 怎么在excle输入下列公式