solve cake_thief problem with dynamic programming
bleh