If the bottom is a square with sides equal to x then, the area is equal to x². The height of the pool is then equal to,
273/x²
Solving for the cost,
sides: (273/x²)(x)(4)(77) = $84084/x
bottoms: x²(22) = 22x²
Adding up all the cost will give us an answer of,
84084/x + 22x²