This problem has been bugging me for literally a decade. I don't quite have the chops to solve it on my own.
Let's start with the basic, 2-dimensional problem.
You have 100 meters of fencing. You need to enclose two equal areas. What's the greatest area you can enclose?
The trick is to realize that two squares aren't the answer, and the "simple" answer is a circle with a line through it. However, it turns out the "Best" answer is actually two partial circles fused together, creating a goggle-like effect. The interior angle for the part of the circle that's going to the fused middle line instead of circling around is 120 degrees.
The math (It's been awhile, and I can't quite remember all of it)
$$P = 2*R(Angle in Radians)+(R^2+R^2-2R^2Cos(Angle))$$ The perimeter of a partial circle, times 2, plus the length of the side, determined with the law of cosines. Formula isn't collapsed more to preserve the logic/ease of viewing.
$$A= 2*(Area of two circles - area of a slice of circle + area of a triangle slice)$$
$$A= 2*(pi*R^2 - Angle/2*R^2 + area of a triangle slice)$$
When solving for 3 dimensions, you get 120 degrees again - two spheres fused with a circular plane between them.
I've tried, and failed, quite a few times to generalize this solution into N-dimensions. I'm aware this is entirely impractical, but it's been driving me nuts for over 10 years at this point, and I'd love some help on it.