a small computation-intensive investment company is doing a simulation in which they look at n consecutive days of a given stock, at some point in the past. for each day, they have a price per share for the stock on that day, assuming that the price was fixed during each day. suppose during this time period, they wanted to buy 1,000 shares on some day and sell all these shares on some (later) day. they want to know: when should they have bought and when should they have sold in order to have made as much money as possible? (if there was no way to make money during the n days, you should report this instead.)