This is urgent, can anyone help me please?

1) A rectangular box (with top) has a square base. The sum of the lengths of its 12 edges is 96. What dimensions should the box have so that its surface area is as large as possible?

I don't understand how to do this one

2) A rancher wants to fence off an area of his ranch to create a rectangular pen. The rancher finds that the fencing in the east-west direction will require extra reinforcement due to strong prevailing winds. Because of this, fencing in the east-west direction will be $12 per meter, as opposed to a cost of $8 per meter for fencing in the north-south direction

a) Given that the rancher wants to spend $4800 for fencing, express the area of the rectangle as a function of its width

b) What are the dimensions of the pen which will maximize the area for the $4800?

I tried finding the function but it confuses me