For example, if your maximum line length was 5, the first 5 arrivals would all go in the first line, so the output at that point would be
Line 1: 0 1 2 3 4But when the next user arrived, this line would split so you would have the following:
Line 1: 0 1 2 Line 2: 3 4 5The next user would joint the shortest line, which could be either, and so on. When a line exceeded 5, it would again split. So after a few more arrivals you might have this:
Line 1: 0 1 2 6 8 Line 2: 3 4 5 7 9The next arrival will cause Line 1 to split (if that's where it's added):
Line 1: 0 1 2 Line 2: 3 4 5 7 9 Line 3: 6 8 10And so on. Note that the numbering of the lines does not matter; my Line 1 could be your Line 3