120 meters of fence are available to build a rectangular pen that is also divided in half by a fence. Let the width of this pen be x. Express the total area of the pen in terms of x and find the value of x for the greatest total area.