프로그램 명: stfd_gumdrops
제한시간: 1 초

Gwen just bought a bag of gumdrops! However, she does not like carrying gumdrops in plastic bags; instead, she wants to pack her gumdrops in a cylindrical tube of diameter d . Given that each of her gumdrops are perfect spheres of radii r 1 , r 2 , . . . , r n , find the shortest length tube Gwen can use to store her gumdrops

You should assume that the gumdrop radii are sufficiently large that no three gumdrops can be simultaneously in contact with each other while fitting in the tube. Given this restriction, it may be helpful to realize that the gumdrops will always be packed in such a way that their centers lie on a single two-dimensional plane containing the axis of rotation of the tube.

입력

출력

Print the length of the shortest tube, rounded to the nearest integer.

입출력 예

입력

2 98.1789
42.8602 28.7622

출력

138

입력

3 747.702
339.687 191.953 330.811

출력

1628
출처:standford/2008/

[질/답] [제출 현황] [푼 후(0)]
[ 채 점 ] [홈으로]  [뒤 로]