Problem 1001 --Cylinder

1001: Cylinder

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $207$ 正确数量 $76$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签 数学

Using a sheet of paper and scissors, you can cut out two faces to form a cylinder in the following way:


Cut the paper horizontally (parallel to the shorter side) to get two rectangular parts.

From the first part, cut out a circle of maximum radius. The circle will form the bottom of the cylinder.

Roll the second part up in such a way that it has a perimeter of equal length with the circle's circumference, and attach one end of the roll to the circle. Note that the roll may have some overlapping parts in order to get the required length of the perimeter.

Given the dimensions of the sheet of paper, can you calculate the biggest possible volume of a cylinder which can be constructed using the procedure described above?

The input consists of several test cases. Each test case consists of two numbers w and h (1 ≤ w ≤ h ≤ 100), which indicate the width and height of the sheet of paper.

The last test case is followed by a line containing two zeros.

For each test case, print one line with the biggest possible volume of the cylinder. Round this number to 3 places after the decimal point.

10 10
10 50
10 30
0 0
54.247
785.398
412.095

推荐代码 查看1001 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$3 $ms] 刘欢@计算机科学与技术161 428790 2019-05-15 20:29:54
内存最少[$1116 $KB] 刘欢@计算机科学与技术161 428790 2019-05-15 20:29:54
第一AC AOJ大管家 2960 2016-05-18 23:02:00
第一挑战 AOJ大管家 2960 2016-05-18 23:02:00

赛题来源/所属竞赛 NA N/A

竞赛编号 竞赛名称 竞赛时间 访问比赛