First fit algorith for managing DOTA 2 server income teams.... it's average time is 35 seconds on 10000 teams which are created random in range from 1 to 5 players