Minimizing sum of $w_i(y_i - y_c)$ over $y_c$ A person wants to connect $n$ circuit points to the clock signal. Now, the clock signal is going to pass parallel to the x-axis and all those circuit points are going to be connected by vertical to the clock line. Suppose the widths of the vertical wires in the given diagram also vary varying.

If the coordinates $(x_i,y_i)$ for each circuit point $c_i$ to be connected  are given, find $y=y_c$, through which the clock line should pass to minimize the expression
$$L = \sum_{i=1}^n w_i(y_i - y_c)$$
Also prove that your solution is optimal.
$x_i$ is irrelevant, it doesn't appear in the objective function.
$y_i$ and $w_i$ are constant.
So the minimization simplifies to:
$$\operatorname*{argmin}_{y_c} \sum{i=1}^n w_i(y_i - y_c) = \operatorname*{argmin}_{y_c} \sum_{i=1}^n w_iy_i - \sum_{i=1}^n w_iy_c,$$
which is either
$$\operatorname*{argmin}_{y_c} -\left(\sum_{i=1}^n w_i\right) y_c $$
or
$$\operatorname*{argmax}_{y_c} \left(\sum_{i=1}^n w_i\right) y_c $$
So depending on whether the sum of your weights is positive or negative, either the highest or lowest $c_i$ should be $c$.