- avoid division by zero
- always generate the requested number of sort packages (even if this implies empty packages)