pre mege
buggy DP for futurecost
all my code is commented in the merge