21539_HowBigIsIt_

2022-5-16 18:19| 发布者: Hocassian| 查看: 30| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-4-89505405698399-Problem List-采集的数据-后羿采集器.html

Pro.ID

21539

Title

How Big Is It?

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=21539

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    Ian's going to California, and he has to pack his things, including his collection of circles. Given a set of circles, your program must find the smallest rectangular box in which they fit.

    All circles must touch the bottom of the box. The figure below shows an acceptable packing for a set of circles ( although this may not be the optimal packing for these particular circles ). Note that in an ideal packing, each circles should touch at least one other circle ( but you probably figured that out ).

    输入

    The first line of input contains a single positive decimal integer n, n < 50. This indicates the number of lines which follow. The subsequent n lines each contain a series of numbers separated by spaces. The first number on each of these lines is a positive integer m, m < 8 , which indicates how many other numbers appear on that line. The next m numbers on the line are the radius of the circles which must be packed in a single box. These numbers need not be integers.

    输出

    Description

    Ian's going to California, and he has to pack his things, including his collection of circles. Given a set of circles, your program must find the smallest rectangular box in which they fit.

    All circles must touch the bottom of the box. The figure below shows an acceptable packing for a set of circles ( although this may not be the optimal packing for these particular circles ). Note that in an ideal packing, each circles should touch at least one other circle ( but you probably figured that out ).

    Input

    The first line of input contains a single positive decimal integer n, n < 50. This indicates the number of lines which follow. The subsequent n lines each contain a series of numbers separated by spaces. The first number on each of these lines is a positive integer m, m < 8 , which indicates how many other numbers appear on that line. The next m numbers on the line are the radius of the circles which must be packed in a single box. These numbers need not be integers.

    Output

    For each data line input, excluding the first line of input containing n, your program must output the size of the smallest rectangle which can pack the circles. Each case should be output on a separate line by itself, with three places after the decimal point. Do not output leading zeroes unless the number is less than 1, e.g. 0.543.

    Sample Input

    3
    3 2.0 1.0 2.0
    4 2.0 2.0 2.0 2.0
    3 2.0 1.0 4.0

    Sample Output

    9.657
    16.000
    12.657

    Source

    样例输入

    3
    3 2.0 1.0 2.0
    4 2.0 2.0 2.0 2.0
    3 2.0 1.0 4.0

    样例输出

    9.657
    16.000
    12.657

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部