I think we can solve this with similar triangles
Call the side length of the cube, s
The diagonal across the cube's base = s * sqrt (2)
1/2 of this = s / sqrt 2
We can construct a triangle with a base = radius of cone - s/sqrt 2 = 3 - s/sqrt 2
And the height of this triangle = s
And the other triangle has a base of the radius of the cone = 3 and a height of 8
And these triangles wil be similar....so.....
3/ 8 = (3 - s/sqrt 2) / s cross-multiply
3s = 8 (3 - s /sqrt 2)
3s + 8s / sqrt 2 = 24
s ( 3 + 8/sqrt 2) = 24
s = 24 / (3 + 8/sqrt 2) ≈ 2.77
