Use a 24-meter fence against the wall to form a rectangular chicken coop, that is, the circumference is one side against the wall and there are three sides left.
When the perimeter is constant, the closer the length and width are, the larger the area is. When the perimeter is equal, the square area is the largest.
24 per side divided by 3 = 8 meters.