Problem 026

Problem

Description

Box

The following figure shows a rectangular card of width W, length L, and thickness 0. Four X x X squares are cut from the four corners of the card shown by the dotted lines. The card is then folded along the dashed lines to make a box without a cover.

Given the width and height of the box, find the values of X for which the box has maximum and minimum volume.

Input

The input file consists of several lines of input. Each line contains two positive floating point numbers L W, which are both less than 10,000, and indicate the length and width of the card, respectively. Here is an sample input:

1 1
2 2
3 3

Output

For each input, give one line of output containing two or more floating point numbers separated by a single space. Each floating point number should contain three digits after the decimal point. The first number indicates the value which maximizes the volume of the box, while the subsequent values (sorted in ascending order) indicate the cut values which minimize the volume of the box. Here is an sample output:

0.167 0.000 0.500
0.333 0.000 1.000
0.500 0.000 1.500

Note

This is based on "13.6.6 The Largest/Smallest Box" in "Programming Challenges" by Skiena and Revilla.

Solution