Bank Account

Alice has 100 dollars in her bank account, and she wants to withdraw at least 10 dollars in the course of 7 days. However, the bank has a weird policy. On the \(i^\text{th}\) day, she will be paid \(p_i\) dollar if she doesn't withdraw any money. If she wants to withdraw, she can only withdraw exactly \(q_i\) dollars.

The table below describes \(p\) and \(q\) on the \(i^\text{th}\) day:


Assume that Alice cannot deposit any money, what is the maximum amount of money can Alice has in her bank account after 7 days?


Problem Loading...

Note Loading...

Set Loading...