I am not getting how book authors came up with the following equation for the answer.

Suppose the cap for a total payroll of T is known to lie between the kth

and (k + l)th salaries. We want Summation A[i] + (n-k)c to equal = T

And I also don’t get the following lines

A = (20,30,40,90,100), and T = 210. The payrolls for

caps equal to the salaries in A are (100,140,170, 270, 280).