How can I make any size object (matchbox,car) fit within the camera view?

Yes, I am looking for a formula. The one I use gets the item close to the reference cube’s size but not enough. I want the largest side of the model to fit the reference cubes scale.