Let C = #courts to photograph Let P = #photographers Let M = #courts/hr maximum for a photographer Let CP = #totalcourts that photographers can cover Let CA = average courts/photographer Let CAF = fractional part of average courts/photographer Let CP1 = courts assigned to current photographer Let CL1 = courts assigned to current photographer last hour last court = 0 For all courts to photograph if C > 0 { if CP1 =< CA assign court else if CAF > 0 AND and CL1 < CA assign court else if last court == current court assign court else { next photographer assign court CP1 += 1; }