poj1201

three methods:
greedy with segment tree,
bellman_ford,
spfa