# C Hacker, pack your bags!

v[i] contains the minimal cost of trip which begins at a[i].first.second or later and has length equal to a[i].first.first.
cur is not trip that you need to take with a[i] - it is the earliest trip that you can take with it, so you need to take trip which begins at a[cur].first.second or later, has length equal to a[cur].first.first and its cost is minimal.