There is a line. On this line, we have $N \le 100$ points $(x_1, x_2, ..., x_n)$, $0 \le x_i \le 10^8$ which are centers of circles. We want to choose such radii for those circles, but in such way that they can't intersect (but they can be tangent). There is one more condition. We want those circles to have the highest possible sum of circumferences. We can write this sum as $2\pi r_1 + 2\pi r_2 + \cdots + 2\pi r_n$, where $r_i$ is radius of circle with center $x_i$. Taking $2\pi$, the task boils down to maximize $r_1 + r_2 + \cdots + r_n$, but with condition that those circles can't intersect. Also, any circle can't be inside any other. You can assume that centers are integers, but radii don't have to be integers. Also, every radius has to be positive (can't be equal to 0).
What is the fastest way to solve this? I would like to design an algorithm which could solve this.
Hint. Assume without loss of generality that $x_1<x_2<\cdots<x_n$, and define the functions $f_i$ as $$ f_i(d) = \text{the largest value of }\sum_{j\le i}r_j\text{ under the additional restriction that }r_i\le d $$ Then each $f_i$ will be a piecewise linear function of a particularly simple shape, and it is easy enough to derive $f_{i+1}$ given $f_{i}$ and the distance $x_{i+1}-x_j$.
Compute them all in sequence, and your answer will be the maximum of $f_n$.
(Actually, a bit of additional thought about the shape of the $f_i$s will reveal that the straightforward greedy algorithm is in fact optimal).