Recently, the Chinese stock market begins to heat up slowly. It is said that in 2009 China's Stock market will re-enter the bull market. Let’s pay some attention to the stock.
Stock is defined as a purely economic issue, it is actually representative of your company's ownership of the shares. But in fact most investors regard it as a kind of commodities, not the production which are made in the factories. Since it is a commodity, there is measurement problem. Fruits are bought by jin, TV sets are bought by set. While the stock is bought in share. Stock and TV set here in set is similar. That is, we can not buy half-shares, and at least buy one share. Of course, stock and fruit, TV set, are different. Stock is so different as the price is changing at all time. Everyone can buy it legally in the trading market. Stock trading costs transaction fees. And the calculation is quite complicated so we don’t dive into this.
To make it easier, we have the problem simplified. First of all, ignore the price changing within a day, meaning that only one constant price on a certain day. Then assuming that only to pay fees when stock are sold, the transaction fee is a fixed value of s.
For example, if the transaction fee is $100. The stock price on the first day is $10 per share. We have $10,000, so we can buy 1,000 shares. The next day, the stock price rise to $11 per share. We sell all the 1,000 shares, so get $11,000. It cost $100 for the fee. So the profit is $900.
In this problem the transaction times is unlimited. You can sell and buy stock time and time again if you like. Now, if we know the stock prices in n trading days, the fee and the initial funding. So, how much money can we earn at most in the n days?