This problem is actually very simple. What we have is a rectangular garden of length l = 50 and width w = 40. To fence this garden in, we would then be looking for the perimeter of the rectangle.
The formula for the perimeter of a rectangle is 2l + 2w = p because we know that the two pairs of sides share the same length.
So you're left with:
p = 2 (50) + 2 (40)
p= 100 + 80
p = 180
Because the measures of length and width were given in meters, we know perimeter will also be in meters. Therefore, we can conclude that the total amount of fencing around it would be 180 meters. Laid out in a straight line, the fence would be 180 meters long.