Sort towers by ascending and sweep left → right:
On visiting tower (x_i,w_i,r_i), add it to a multiset/priority-queue keyed by right endpoint x_i+r_i.
Before processing, remove any element with x_i> x_j+r_j (its radius no longer reaches ).
Maintain the current sum of active weights (alertness) S_L(i) and a container that returns in O(\log n) the maximum weight among actives except itself, let max_L(i) be this maximum. Disabling that candidate minimizes and maximizes .
Repeat symmetrically sweeping right → left, tracking S_R(i) and max_R(i) by left endpoints x_i-r_i.
For tower the two best candidates give
Enumerate all , keep the global maximum and the pair . Overall complexity O(n\log n).