updated algorithm to calculate team size based on num teams