Here is another exercise in arithmetic which obscures the point of the problem.
The perimeter of the square is 4s and the perimeter of the rectangles is 8w.
4s + 8w = 70
The area is s2 +3w2
Use the perimeter equation to get a relation between w and s, e.g.
s=.5(35-4w).
Now substitute the expression for s into the area equation.
Differentiate the expression for area with respect to w.
Set this derivative equal to 0 and solve for w.
The get both 3w an and s.