Remember that density= mass/volume.
You know the average mass, so all you need is the volume. If they are sugar cubes, then that means that each side is approximately the same length, so the volume of a cube is:
V=a^3
Where a is the length of the side of the cube. Crunch the numbers and you'll get your answer.