Answer :

A little thought will make it clear that the answer must be fractional, and that in one case the numerator will be greater and in the other case less than the denominator. 
As a matter of fact, the height of the larger cube must be 8/7 ft., and of the smaller 3/7 ft., if we are to have the answer in the smallest possible figures. Here the lineal measurement is 11/7 ft.—that is, 14/7 ft. What are the cubic contents of the two cubes? 
First 8/7 × 3/7 × 8/7 = 512/343, and secondly 3/7 × 3/7 × 3/7 = 27/343
Add these together and the result is 539/343, which reduces to 11/7 or 14/7 ft. 
We thus see that the answers in cubic feet and lineal feet are precisely the same.

The germ of the idea is to be found in the works of Diophantus of Alexandria, who wrote about the beginning of the fourth century. These fractional numbers appear in triads, and are obtained from three generators, a, b, c, where a is the largest and c the smallest.

Then ab+c2=denominator, and a2-c2, b2-c2, and a2-b2 will be the three numerators. 
Thus, using the generators 3, 2, 1, we get 8/7, 3/7, 5/7 and we can pair the first and second, as in the above solution, or the first and third for a second solution. 
The denominator must always be a prime number of the form 6n+1, or composed of such primes. 
Thus you can have 13, 19, etc., as denominators, but not 25, 55, 187, etc.

When the principle is understood there is no difficulty in writing down the dimensions of as many sets of cubes as the most exacting collector may require. 
If the reader would like one, for example, with plenty of nines, perhaps the following would satisfy him: 99999999/99990001 and 19999/99990001.

Math Genius