Moroccan Wooden Box

Three famous mathematicians Erich Friedman, David Cantrell and Craig Clapp are visiting Morocco to at- tend the International Computational Programming Conference. As they only plan to visit the conference to enjoy what other people say, they have left all their computers, calculation details back home. But out in the street see many Moroccan Wooden boxes and they plan order two boxes which will be used to keep certain number of things of fixed shape. For simplicity the following things are assumed by them:

  1. The two boxes will have square shapes (As shown in the figure on the left).
  2. The boxes will be used to keep balls of fixed radius.
  3. Exactly seven or eight sphere shaped balls of radius r will be placed in the box.
  4. The boxes should be as large as possible but the things kept inside must remain rigid (should not be able to move in any direction) when the box is closed, regardless of the orientation of the box.
  5. The thickness of the box walls should be considered w units. Now given the radius r of all the balls and the constraints given above, you will have to find the maximum possible volume of two boxes that contain 7 and 8 spheres respectively. As Erich, David and Craig are experts in this field so they also provide you two dimensional sketches of the positioning of the balls that should make the volume maximum. The sketches are shown below Sketch 1: Top view of the cross section (At height r from the bottom) of a box containing seven rigid balls. Sketch 2: Top view of the cross section (At height r from the bottom) of a box containing eight rigid balls. The figures above are accurate but not accurate enough to find the volume of the boxes exactly from the figures only. Some important things about the figures above are (a) When two balls appear to touch each other or the wall, they actually do touch (Otherwise the balls will not remain rigid) (b)

2/2 When three circles appear collinear in naked eye, you cannot assume that they are actually collinear (c) If the circle appears to have equal radius in the cross section, they actually have equal radius. Input The input file contains around 1000 lines of inputs. Each line contains two floating-point numbers r and w (0.01 ≤ r, w < 500). Here r is the radius of all the balls and w is the thickness of the box-wall. Input is terminated with end of file. Output For each line of input produce one line of output. This line contains two floating-point numbers V7 and V8 with four digits after the decimal point. This V7 denotes the maximum possible volume of the box that contains 7 balls and V8 denotes the maximum possible volume of the box that contains 8 balls. Absolute error of less than 10−4 or relative error of 10−9 will be ignored. Sample Input 0.01 0.01 0.02 0.01 Sample Output 0.0003 0.0003 0.0012 0.0015