Optimal shift partitioning of pharmacies