Suppose there are N collectibles. You can call a minimum of 1 person to a maximum of k persons to collect those collectibles for you. The number of people you call would share a number of collectibles equally among them in the highest equity possible for the value of N. You get the remaining collectibles that are left over. Optimize the number of people called so that you can get the maximum possible no. of collectibles, and output that maximum possible number of collectibles which you could get. For example, if there were 11 collectibles, and you could call a maximum of 3 persons, then you could get 2 collectibles at most. This is because if you'd call 3 persons, they'd distribute the collectibles in the highest equity possible out of 11, that is 3. So you'd be left with 2 collectibles.
An obvious way of approaching the problem is to set up a loop running until k, and storing the maximum possible N modulo k. But this being a blunt approach, I want to make the code more efficient by maximizing N modulo k under the constraints that N is fixed and k<=N. Can someone provide me with a possible approach to optimize the above problem?
PS: I've not included any code, as the blunt approach is quite obvious, and I'm seeking for an approach for the way I desire to proceed through the problem, and not the code.