EIUDEPRE - Depreciation
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:
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
ABC Company has just installed a new production line. The company is considering the appropriate method and rate of depreciation for each year. By design, the equipment has a shelf life of ~N~ years. In the first year, the depreciation rate is assumed to be ~X~, the company wants the depreciation rate to decrease gradually according to the number of years of use as follows:
- First year: ~X~
- Second year ~X – X*1/N~
- Third year: ~X – X*2/N~
- …
After ~N~ years of usages, the value of the equiqment is ~R~. Caculate the initial value of ~X~
Input
- A single line has three numbers separated by a space, the corresponding number of years using ~N~ (~1 \leq N \leq 1000~), initial value ~C~ (~0 < C < 10^{18}~), and residual value (~0 < R < 10^{18}~) .
Output
- Print out the depreciation rates for the first year with ~6~ decimal place accuracy
Example Input 1
5 1000000000 500000000
Example Output 1
0.2122959
Bình luận