From a professional standpoint, determining the optimum for a medium sized cluster is months of work.
First you have to determine the load type and devise a benchmark. This alone is no easy task and can take weeks because you have to find out what architecture best fits your computing problem.
Then you have to test all available components and test their speed and cost including space, power, cooling.
Normally you would call for bids, specifying the load case, benchmark, power and space cost. The bidders would then try to find the optimum.
For a system consisting of about 150 1-unit computers we usually spent three person-months to determine the real optimum when power and space consumption was a factor. The cost for space and power usually was in the vicinity of the purchasing price.
Since your question contains none of the required information, it is impossible to answer.