I'm a twisty puzzles collector. Here you can see my current collection of ± 300 puzzles.
I think everyone knows the regular Rubik's Cube (3x3x3 Cube), which is a NxNxN Cube. There are also Cuboids (block-shaped puzzles), which come in different forms, perhaps better explained by SuperAntionioVivaldi here:
- Regular Domino Cuboids (like the 2x2x3; 2x3x3; 3x3x4; etc.) - They come in the form of NxNx(N+O) or Nx(N+O)x(N+O), which have either two odd dimensions and an even, or two even and an odd.
- Shapeshifter Cuboids (like the 2x2x4; 3x3x5; 3x3x9; 4x4x6; etc.) - They come in the form of NxNx(N+P), which as the name suggests, shapeshifts (in all directions). All three dimensions are either odd or even.
- Floppy Cuboids (like the 1x3x3; 2x4x4; etc.) - They come in the form of Nx(N+P)x(N+P), which are almost the same as the Shapeshifters, but with so-called Floppy Parities.
- Brick Cuboids (like the 2x3x4; 3x4x5; 2x3x5; etc.) - They come in the form of Nx(N+O)x(N+P), which just like the Regular Domino Cuboids have either two odd dimensions and an even, or two even and an odd; but don't have any of the same dimensions.
- Ultimate Shapeshifters (like the 2x4x6; 3x5x7; 2x4x10; etc.) - They come in the form of Nx(N+O)x(N+R), and shapeshift in any direction. All three dimensions are either odd or even; but don't have any of the same dimensions.
A positive integer n with the following restriction: 8 <= n <= 125.
n can be uniquely decoded as the product of three values (the dimensions), of which each is between 2 and 5 inclusive.
The reason I've restricted it to 2-5 is to prevent duplicated inputs (like
1x2x4 = 8 and
2x2x2 = 8), even though there are many lower/higher order Cuboids out there. This also means there are no test cases for Ultimate Shapeshifters.
Output / Test cases:
These are all the cases your program/function should support, ranging from edge lengths 2 through 5 in every possible three-dimensional configuration:
Input Cuboid/Cube Type/Output 8 2x2x2 Cube 12 2x2x3 Regular Domino Cuboid 16 2x2x4 Shapeshifter Cuboid 20 2x2x5 Regular Domino Cuboid 18 2x3x3 Regular Domino Cuboid 24 2x3x4 Brick Cuboid 30 2x3x5 Brick Cuboid 32 2x4x4 Floppy Cuboid 40 2x4x5 Brick Cuboid 50 2x5x5 Regular Domino Cuboid 27 3x3x3 Cube 36 3x3x4 Regular Domino Cuboid 45 3x3x5 Shapeshifter Cuboid 48 3x4x4 Regular Domino Cuboid 60 3x4x5 Brick Cuboid 75 3x5x5 Floppy Cuboid 64 4x4x4 Cube 80 4x4x5 Regular Domino Cuboid 100 4x5x5 Regular Domino Cuboid 125 5x5x5 Cube
- Any non-Cube/non-Cuboid input within the 8-125 range should result in 'none' as output.
- The output format is your own choice. I think the most reasonable is integers, like
2= Regular Domino Cuboid;
3= Shapeshifter Cuboid;
4= Floppy Cuboid;
5= Brick Cuboid. Any other output format is also fine, as long as you specify which one you've used.
- This is code-golf, so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
- Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.
- Default Loopholes are forbidden. (NOTE: Since I don't know if there is a smart formula for the input-to-output conversion, it is allowed to hardcode the answers based on the input.)
- If possible, please add a link with a test for your code.
- Also, please add an explanation if necessary.