Submit | All submissions | Best solutions | Back to list |
EIAPP21222FQ1 - EIUSAVING 1 |
Normally, interest rates for saving deposits depend on how long the deposits are (see the table below). Minh has N dong and want to deposit money for M months. Find out the maximum amount of money Minh can receive after M months. Interest will be added to account at the end of each period (not rounded).
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% |
Input
The first line contains 2 integers N, M (0 < N ≤ 105, 0 < M ≤ 1000).
Output
The maximum amount of money (rounded to unit).
Sample
Input |
Output |
5000 4 |
5067 |
10000 14 |
10762 |
Added by: | Ha Minh Ngoc |
Date: | 2022-03-27 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: GOSU |