# 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:

 i 1 2 3 4 5 6 7 p 5 4 8 4 9 6 3 q 4 9 5 2 5 2 6

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

×