F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Cylinder

Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 678    Accepted Submission(s): 281


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

1. Cut the paper horizontally (parallel to the shorter side) to get two rectangular parts.
2. From the first part, cut out a circle of maximum radius. The circle will form the bottom of the cylinder.
3. 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?

 

Input
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.

 

Output
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.

 

Sample Input
10 10 10 50 10 30 0 0
 

Sample Output
54.247 785.398 412.095
 

Hint

In the first case, the optimal cylinder has a radius of about 1.591549,
in the second case, the optimal cylinder has a radius of 5,
and in the third case, the optimal cylinder has a radius of about 3.621795.
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 12:29:51, Gzip enabled