Submit | All submissions | Best solutions | Back to list |
EIUDEPRE - Depreciation |
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 ≤ N ≤ 1000), initial value C (0 < C < 1018), and residual value (0 < R < 1018) .
Output
Print out the depreciation rates for the first year with 6 decimal place accuracy
Example
Input: 5 1000000000 500000000 Output: 0.2122959