the 5th test case has a weird answer, which I've tried really hard to figure out why it is the way it is but I can't seem to figure it out.
The number 78 occupies team 1, and only one teammate because number 95 took number 52, and number 95 couldn't take number 76 because 96 took 76 and 49. So far the solution is: 122111 Then it gets weird. Number 100 was the first one to choose, and it chose number 77 and 64. The solution is: 122111xx111 xx are numbers 53 and 59. 59 is the first one to pick, and it picks for the team #2, so by logic of my task, it should pick itself and number 53 with it, but it doesn't, instead the number 53 becomes team #1 which I just don't understand.
Any help ?
And yes I've read the editorial, but I did this task before reading it and I'd like to know why the editorial is better than this solution.