Dividing bins into segments
For $0 \leq i \leq pm+1$, define
$$
x_i = \left\lfloor i \frac{pn+1}{pm+1} \right\rfloor.
$$
We put ball $i$ in bin $i$ for $1 \leq i \leq pm$. The length of the $i$th space (for $1 \leq i \leq pm+1$) is
$$
x_i - x_{i-1} = \left\lfloor i \frac{pn+1}{pm+1} \right\rfloor - \left\lfloor (i-1) \frac{pn+1}{pm+1} \right\rfloor \in \left\{ \left\lfloor \frac{pn+1}{pm+1} \right\rfloor, \left\lceil \frac{pn+1}{pm+1} \right\rceil \right\},
$$
so your first condition is satisfied (the spaces are as equal to each other as possible).

For your second condition, we need to verify that $1 \leq x_1,\ldots,x_m \leq n$, $n+1 \leq x_{m+1},\ldots,x_{2m} \leq 2n$, and so on. It's clearly enough to verify that $x_{Cm} \leq Cn$ for $1 \leq C \leq p$ and that $x_{Cm+1} &gt; Cn$ for $0 \leq C &lt; p$. For the first condition, we have
$$
x_{Cm} = \left\lfloor Cm \frac{pn+1}{pm+1} \right\rfloor &lt; Cm \frac{pn+1}{pm+1} + 1 = \frac{Cpmn + Cm + pm + 1}{pm+1} \\ &lt; \frac{Cpmn + Cn + pm + 1}{pm+1} = Cn+1,
$$
using your implicit assumption $m &lt; n$. For the second condition,
$$
x_{Cm+1} = \left\lfloor (Cm+1) \frac{pn+1}{pm+1} \right\rfloor \geq (Cm+1) \frac{pn+1}{pm+1} = \frac{Cpmn + Cm + pn + 1}{pm+1} \\
\geq \frac{Cpmn + Cn + pm + 1}{pm+1} = Cn+1,
$$
using $Cm + pn \geq Cn + pm$, which follows from $(p-C)(n-m) \geq 0$.