Question about Measuring Traffic

I’ve been working on Measuring Traffic and I can’t understand the logic behind a specific solution about it. So the solution in question is as such: Solution - Measuring Traffic (USACO Bronze February 2019)

It updates minimum and maximum values of cars by each mile but my question is, if we have a series of off and on ramps then our high and low would represent the maximum and minimum number of cars that have gotten on the ramp from that point on. However, the comparison for the solution notes that we have high update itself by comparison.

What I don’t understand is, if we have an understanding of how many cars have gotten on or off from a certain point, how can that piece of information give any clue as to how many cars there were at a former section of the track.

For instance, if I know that between 30 and 35 cars have gotten on from mile i, and the sensor for mile i states that between 27 and 37 cars passed through it, i update my high and low to 30 and 35.
Hence, I’d be getting information about how many cars there were through something that can’t possibly tell me how many cars there were as the number of cars that got on has no relation to the number of cars that were there to begin with.

I’m confused about this specific part, could someone please let me know what fallacy I’m making here?
Thanks!

Let’s use this snippet from the sample input:

none 11 15
off 2 3

This means that we first know that there’s between 11 and 15 cars, and then 2 to 3 cars got off.
The new minimum is 8, since we could have had 11 cars and then 3 cars get off.
Then, the new maximum is 13, since we could have had 15 cars and then 2 cars get off.
Does this make things any clearer?

Yea thanks for the reply!
I sort of sat down for a bit and just thought about it, and it just suddenly felt more intuitive idk how.
Yea, it makes sense to think of it in blocks instead of as a whole.
Thank you!

@SansPapyrus683 I understand that the minimum would be 8 and the maximum 13. However, how does the sample case show that after mile 4, the minimum would be 8 the maximum 12? How is the maximum 12 and not 13?

What’s your reasoning for this maximum?

The maximum would be 13 because only 2 cars could leave and that would leave with a range from 8 to 13.

Is this consistent with the rest of the input?
If 13 cars were at the end, then 15 cars would be at mile 3.
This is conflicts with the reading at mile 2.

Ahhhhh, I understand now. Thank you.