A metallic cuboid measuring 16 cm by 8 cm by 4 cm was melted. The material was then used to make a cube. What was the length of the cube?