A rectangular box is to have a square base and a volume of 40 ft3. If the material for the base costs $0.30 per square foot, the material for the sides costs $0.05 per square foot, and the material for the top costs $0.20 per square foot, determine the dimensions of the box that can be constructed at minimum cost.