If one raw contains 3x-2 trees & if the total trees in the rectangle are 24x-16, that means Horizontal Rows x Vertical Rows =Total number of trees:
(3x-2) * Vertical Rows = 24x-16 ===> Vertical Rows =(24x-16) / (3x-2)
Perform the division & you will find Vertical Rows =8