Given:
Rectangular enclosure w/ area of 8km²
Area = length * width
Solve for perimeter of 3 sides only. The river will serve as the 4th side of the enclosure.
Possible dimensions:
8 = 8 x 1 ; P = 8 + 1 + 1 = 10 km.
8 = 4 x 2 ; P = 4 + 2 + 2 = 8 km.
Best dimension is length of 4 km and width of 2 km. The river will serve as the other length. It will only need 8 km of fence to enclose the area 8 km².