前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >【每日一题】问题 1111: Cylinder

【每日一题】问题 1111: Cylinder

作者头像
编程范 源代码公司
发布2018-12-27 10:51:09
6030
发布2018-12-27 10:51:09
举报

关注最新赛事,比赛详细,有意思的程序段子就点击上方蓝字关注我们吧~

题目描述

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

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2018-12-13,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 编程范 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档