6. 15 points
There is a set of jobs {1,2,.., n} and a machine, each job i takes $t_i$ time to complete
by the machine. Given a schedule (i.e., an ordering of the jobs), let $C_i$ denote the
finishing time of job i. For example, if job j is the first to be done, then $C_j = t_j$; and
if job j is done right after job i, then $C_j = C_i + t_j$. Each job i also has a given weight
$w_i$. Design an efficient algorithm which, given a set of n jobs with a processing time $t_i$
and a weight $w_i$ for each job i, orders the jobs so that the sum $\sum_{i=1}^{n} w_iC_i$ is minimized,
and analyze your algorithm.