"Each passenger is traveling for some number of stops and the same passenger never boards the same train more than once."
Strictly speaking, if a passenger enters the train and leaves immediately (which is equivalent to traveling zero stops), the ticket does not get inspected, and it should be accounted to the answer. It seems like the problem is implying that "some number" is positive, because the output of example 3 would be 5 16 otherwise.
I suggest including the following sentence at the end of the paragraph 2.
kcits970 2년 전 1
(2nd paragraph, 2nd sentence)
"Each passenger is traveling for some number of stops and the same passenger never boards the same train more than once."
Strictly speaking, if a passenger enters the train and leaves immediately (which is equivalent to traveling zero stops), the ticket does not get inspected, and it should be accounted to the answer. It seems like the problem is implying that "some number" is positive, because the output of example 3 would be 5 16 otherwise.
I suggest including the following sentence at the end of the paragraph 2.
"No passengers enter and leave at the same stop."