A wire 16 meter long has to be molded in a rectangular shape. What dimensions about the rectangle has to be used to maximize the cost?

HUH ? Why would anybody want to maximize cost?

Are you mixing up the wording of two different questions?
Your last sentence makes no sense.