Solved Segment Trees
Solved Bellman-Ford