Let's look at the picture, let's imagine that the gray line is the perimeter fence and that the red OR the blue is the one dividing it. We can see that the blue line is longer than the red one, so it will be advantageous, to have a bigger area, to have the dividing fence the smallest possible.
Let's say then that the width (W) is bigger (or equal) to the length (L), so we have:
The area is W*L, so we have
this function is a parabola facing down, its zeros are 0 and 80, therefore its maximum is when L=40
hence, L=40 and W=(240-120)/2=60
It will be a rectangle, measuring 60x40 and the divinding fence will be 40