EIUSAVING 2
Xem dạng PDF
Gửi bài giải
Điểm:
1,00 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
256M
Input:
stdin
Output:
stdout
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
Normally, interest rates for saving deposits depend on how long the deposits are (see the table below).
| Number of months | Interest rates (each 12 months) |
|---|---|
| 1 | 3.90% |
| 2 | 3.92% |
| 3 | 3.95% |
| 4 | 3.99% |
| 5 | 4.04% |
| 6 | 5.54% |
| 7 | 5.72% |
| 8 | 5.92% |
| 9 | 6.14% |
| 10 | 6.38% |
| 11 | 6.64% |
| 12 | 6.92% |
Each month, Minh deposits some money into a savings account. Interest will be added to account at the end of each period (not rounded).
Calculate the maximum amount of money Minh can receive after N months.
Input
The first line contains an integer N (0 < M ≤ 1000).
The second line contains M integers which are the amount of money Minh deposits into his account in M months (respectively).
Output
The maximum amount of money (rounded to unit).
Example
Input
4
1000 2000 3000 1000
Output
7056
Bình luận