I have a sequence $s$ of rational numbers where $|s|=n$. I am given a percentage $p$ to partition the sequence $s$ into $\frac{1}{p}$ parts, such that each part contains $p\%$ number of elements of the whole sequence.
However, it becomes problematic for certain $n$ and $p$ combinations. For example, for $n=50$ and $p=5\%$, we are supposed to obtain 20 parts/sub-sequences. If we have $3$ elements per part, we will only have 17 of them while the last one contains only $2$ elements. If we have $2$ elements per part, we will have 20 of them but the last one will contain $12$ elements.
The purpose of partitioning the sequence in the first place is to calculate the mean for each resulting sub-sequence, i.e. that of first $p\%$, that of second $p\%$, and so on.
So what is a good way to deal with this situation?