First you calculate the perimeter of the garden:

(2*30) + (2*16) = 92 ft or 1104 inches

Then you divide the perimeter by the spacing between each light:

1104 inches / 18 inches = 61.33

Obiously you can't have 61.33 lights ;) so 61 lights would have just over 18 inch gaps around the rectangle and 62 lights would have just under 18 inch gaps around the rectangle.

Hope this helps! :)