<resource source="TC" title="Intro to Graphs Section 3" url="introduction-to-graphs-and-their-data-structures-section-3/"></resource>
</resources>
Can also use [Shortest Path Faster Algorithm](https://en.wikipedia.org/wiki/Shortest_Path_Faster_Algorithm) or modify Dijkstra slightly (though the same running time bound no longer applies).
You can also use shortest path algorithms to solve the following problem (a very simple [linear program](https://en.wikipedia.org/wiki/Linear_programming)).
<resource source="MIT" title="Slides from Intro to Algorithms" url="https://www.cs.rit.edu/~spr/COURSES/ALG/MIT/lec18.pdf">Linear Programming Trick</resource>
- equivalent to [Timeline (Gold)](http://www.usaco.org/index.php?page=viewproblem2&cpid=1017) except $N,C\le 5000$ and negative values of $x$ are possible.