Total length of pieces after splitting If I consider the number line from $0$ to $n$ and cut it into $x$ pieces, it is well known that there is at least one stretch of length at least $n/x$. My question is what is the minimum total length of all the pieces of length at least $y$. 
For example, if I split the line into three pieces and set $y = \frac{n}{3}$ then by making one piece fractionally greater than $\frac{n}{3}$ and the other two smaller, we can make the total length fractionally greater than $\frac{n}{3}$. If we set $y=\frac{n}{4}$ keeping $x=3$ then the minimum total length seems to be just over  $\frac{n}{2}$.  From this one can guess an answer of $n-(x-1)y$. Is this the correct answer and how can one prove it?
 A: Here's a full edit to correct my statement and provide a proof:
I claim the minimum is 
$$\begin{cases} n - (x-1)y & \text{whenever } xy < n, \\ 0 & \text{otherwise.}\end{cases}$$
Here's how we may prove the claim. Observe that the minimum total length of the parts with length at least $y$ is $n$ minus the maximum total length of the parts less than $y$. Now whether we consider parts of length $< y$ or $\leq y$ isn't quite important, because by replacing $y$ by $y - \epsilon$, where $\epsilon$ is a very very small positive number, we get the same answer. Let us find the maximum total length of the parts of length less than or equal to $y$.
Suppose $xy < n$, and divide the interval $[0,n]$ into $x$ parts of lengths $s_1,s_2,\ldots, s_x$. Since $s_1 + \ldots + s_x = n$, there are at most $x - 1$ parts of length less than or equal to $y$ (otherwise $s_1 + \ldots + s_x \leq xy < n$). Thus, $$\sum_{s_k \leq y} s_k \leq (x-1)y$$
Now notice that the solution $s_1 = s_2 = \ldots = s_{x-1} = y, s_x = n - (x-1)y$ achieves this maximum, so we're done.
If, on the other hand, $xy \geq n$, then we can easily find a solution with $\sum_{s_k \leq y} s_k = n$. Since the sum of all $s_k's$ is $n$, this must be the maximum.
Therefore, the maximum is $$\begin{cases} (x-1)y & \text{whenever } xy < n, \\ n & \text{otherwise,}\end{cases}$$
which completes the proof.
