Solution (source code)

= Solution

The transformation $N=k/p$ is strictly decreasing for $p>0$. Therefore an <interval> $[L,U]$ with $0<L<U\leq1$ transforms to
$$
\boxed{\left[\frac kU,\frac kL\right]}.
$$
The event $L\leq p\leq U$ is exactly the event $k/U\leq N\leq k/L$, so the approximate coverage is inherited. If the lower endpoint for $p$ reaches zero, the transformed upper endpoint for $N$ is $+\infty$; if the upper endpoint reaches one, the lower endpoint is $k$. Finally intersect with <integer> values $N>k$, rounding the lower bound upward and the upper bound downward. This respects the original discrete population constraint.