from the top of a cliff which is 200 m above the sea level the angles of elevation of 45 degree and 30 degree find the distance between the ships if the ships are

A- on the same side of the Cliff
B- on the opposite side of the clips

as always, draw the diagram and review your basic trig functions

(A) d = 200 cot30° - 200 cot45°
(B) d = 200 cot30° + 200 cot45°

This only applies if the point just below the observer lies on the line joining the two ships. Otherwise it gets a bit more complicated.