Have you drawn a sletch? You want two parallel lines which are the sides of the slip and therefore 54 apart... They stop at the same 'point' - rather, at the same perpendicular. We don't care what happens alot further on up the slip, but the slip stops where it reaches one side of the perpendicular 'channel'. Then a straight line representing the ship (and 250 long) reaches inside the slip so that one end of the ship-line touches one of the slip-side-lines and the end-point of the other slip-side-line touchesit.

Now label...

z, let's say, is the length of ship inside the slip - this is the hypotenuse of a right triangle, and 54 is the length of the side opposite an angle theta. Call the remaining ('adjacent') side x. Get a trig expression for x and one also for z in terms of theta.

Now compare with the larger and similar right triangle whose hypotenuse is the whole ship. Let u be the necessary width of channel when the ship is in this position - for the current value of theta. You should be able to get a function (to be maximised with calculus) that gets u from theta. Use the ratios in the similar triangles. Specifically,

Make u the subject, and replace x and z with functions of theta. Maximize.

Here's roughly what I was hoping to describe...

Hope this helps.