Text this: Reservoirs optimization with dynamic programming