https://codeforces.com/contest/1154/submission/52943271

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.

`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`

. You were right until here, then when it's 78th number's turn it takes 59 with itself, since all the numbers between them were already taken.Thank you for your answer, the problem statement badly explained what to do with the number when there's nobody to draft nearby.