Don't know what the diagram looks like but I assumed
a rectangle against the wall, (one length not needed)
I then split that rectangle into 4 equal rectangles
For a small rectangle , let the width be x and its length by y.
So I will need 6x + 4y = 80
3x + 2y = 40
y = (40-3x)/2
area of whole big one = (2x)(2y) = 4xy
= 4x(40-3x)/2
= 80x - 6x^2
d(area) = 80 - 12x = 0 for a max of area
x = 80/12 = 20/3
then y = (40-3x)/2
= (40 - 20)/2 = 10
state you conclusion