A fence is to be built to enclose a rectangular area of square feet. The fence along three sides is to be made of material that costs ​$ per foot. The material for the fourth side costs ​$ per foot. Find the dimensions of the rectangle that will allow for the most economical fence to be built.