USACO 2020 December Contest, Bronze, don't understand solution

http://usaco.org/index.php?page=viewproblem2&cpid=1061
In this problem the output says
5
3
Infinity
Infinity
2
5

For the fourth 3rd cow, I don’t understand why it would go on infinitely. It is traveling East starting at (4,6) and there is another cow that is traveling North starting at (11,2) (the fifth cow). Wouldn’t the 3rd cow collide with the path that the cow traveling North leaves behind after 7 hours because after 4 hours, the cow traveling North is on the same y level as the cow traveling east, and then the cow traveling east still travels for 3 more hours before reaching that path’s x value and then stopping? My code is working for all the other cows, just not this one.

My output:
5
3
7
Infinity
2
5

Cow 5 stops before it has a chance to go in front of Cow 3’s path.