EIINTEREST2 - Tet holiday discount

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

Nguồn bài:
Hà Minh Ngọc
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch

After withdraw money from the bank, Phuc want to find out how much the actual interest rate was applied to his saving account. Please help him.

Input

  • The first line contains two integer ~N~ and ~M~. These numbers, in turn, denote the amount of money Phuc received and number of months he deposited money into his account. (~N < 10^{18}~, ~M \leq 120~)
  • The second line contains ~M~ non-negative integers which are amount of money Phuc put into the account in the increasing order of time.

Output

  • A real number which is the actual interest rate (rounded to ~3~ decimal places)

Example Input 1

50071920 10
3200000 4500000 4200000 6000000 4100000 3500000  4000000 4450000 3750000 3950000

Example Output 1

0.033

Bình luận

Hãy đọc nội quy trước khi bình luận.


Không có bình luận tại thời điểm này.