A livestock pen is built in the shape of a rectangle that is twice as long as it is wide. The perimeter is 48 feet. If the material used to build the pen is $1.75 per foot for the longer sides and $2.25 per foot for the shorter sides (the shorter sides have gates, which increase the cost per foot), find the cost to build the pen.