Count Robot Groups
Each adjacent pair of robot groups has a first moment it comes within distance; process those moments in time order and merge into the right-hand group.
Each adjacent pair of robot groups has a first moment it comes within distance; process those moments in time order and merge into the right-hand group.