A simple forward algorithm to solve general dynamic lot sizing models with n periods in 0(n log n) or 0(n) time