Let's call the number of rows 'R'.
There are (3x -2) trees in each row, and there are 'R' rows,
so the total number of trees is [ R times (3x-2) ].
But the problem told you that the total number of trees is (24x-16).
So
R(3x - 2) = (24x - 16)
Factor '8' out of the right side:
R(3x - 2) = 8(3x - 2)
Divide each side by (3x - 2) :
R = 8
There are eight (8) rows of trees.