Where did you pick that question? I think I have seen one like that on a SAT practice exam which I took if It's not that one.
So, the perimeter of a rectangular area is P=2w+2l (because you have to calculate all sides). So, in the first garden, the perimeter is 2w+2l=34 and in the second garden is 2.2w +2.l/2 = 26 that is 4w+l=26
So we have a system:
First garden 2w+2l=34
Second garden 4w+l =26 (multiply by -2 to cross the l out)
So it stays: 2w+2l=34
-8w-2l=-52
(so cross the l out and add the other terms) we have -6w= -18 (multiply by -1) we have 6w=18 w=3
Once we have w=3 just plug in one equation: 2l+2x3=34 2l+6=34 2l=28 l=14
So the dimension of the first garden is 14x3 (just one time, so we don't have to multiply because we are only calculating the dimension and not the perimeter again) and the dimension of the second garden is 7x6 (we have a length of 14 and divide by 2 because it is only one side to see the dimension, so it is 7) and width is 4x3 = 12 divide by 2 because it is only one side we have 6).
So, the first garden is length 14 and width 3;
The second garden is length 7 and width 6.