Optimization with dimensions

Give us the dimensions and we'll do the rest