This page is still under construction.

Parts of this page are still being built. What you see may change.

Cylinder

Time limit1sMemory limit128 MB

Summary
Given a w by h sheet, cut it into two pieces, make a circle base from one and roll the other into the side, and maximize the cylinder volume.
Level

Medium6 of 10

Topics
Geometry, Math, Brute force
Solved
No attempts yet

Problem

With a sheet of paper and a pair of scissors, you can cut out two faces and assemble a cylinder as follows:

  1. Cut the paper crosswise (parallel to its shorter side) into two rectangular pieces.
  2. From the first piece, cut out a circle of the largest possible radius. This circle becomes the base of the cylinder.
  3. Roll the second piece so that its perimeter equals the circumference of the circle, then attach one end of the roll to the circle. The roll may overlap itself in order to reach the required perimeter length.

Given the dimensions of the sheet of paper, compute the largest possible volume of a cylinder that can be built with the procedure above.

Input

The input consists of several test cases. Each test case contains two numbers ww and hh (1≤w≤h≤1001 \le w \le h \le 100), the width and the height of the sheet of paper.

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

Output

For each test case, print a single line with the largest possible volume of the cylinder, rounded to three digits after the decimal point.

Examples1

  1. Example 1

    Input
    10 10
    10 50
    10 30
    0 0
    
    Expected output
    54.247
    785.398
    412.095