To sum up the discussion in the notes: The OP knows that the cuboid shares the same center as the cube and has six points of contact with the cube, and also knows the orientation of the cuboid. Also, the OP knows the equations of the planes of the faces of the cube. Therefore, the solution method is to let $l,w,h$ be the unknown dimensions of the gray cuboid. Then based on its orientation, you can write an expression in $l,w,h$ for the the "top" vertex of the cuboid. Since that touches the top face of the cube, you know it must satisfy the equation of that plane, which yields one equation in $l,w,h$. Do the same for the two other independent contact points (i.e., not the "bottom" vertex, which by symmetry will give you an equation equivalent to the first), and you will have three equations in $l,w,h$ which you solve, and then you know everything about the cuboid.