calc_n_cost function

Calculates number of plots for optimal allocation with variable cost