A bullet of mass $m$ is fired into a block of mass $M$ initially at rest at the edge of a frictionless table of height $h$ (Fig. P9.57). The bullet remains in the block, and after impact the block lands a distance $d$ from the bottom of the table. Determine the initial speed of the bullet.