Home Page | Web Board | Problems | Standing | Status | Award Contest |
Problem I:Rate of Return Time Limit:1000MS Memory Limit:65536K Description
Jill has been investing in a mutual fund for a while. Since her income has varied, the amount of money she has added to the investment has varied, and she hasnĄ¯t always added to the investment at regular intervals. Nevertheless, she does have a complete record of the amounts she has invested, and the dates of those investments.
Input
The input will contain multiple cases. The input for each case will begin with an integer N (no larger than 12) that indicates the number of times Jill invested in her mutual fund. This will be followed by N + 1 pairs, each pair containing an integer and a real number. The integer represents a month number (1 or larger) and the real number represents a dollar amount. The first N pairs give the month and amount of each of JillĄ¯s N investments in the mutual fund, and the last pair indicates the value of the investment at the end of the specified month. There will be one or more whitespace characters (blanks, tabs, and/or ends of lines) between the input numbers. You may assume that the month numbers are given in ascending order.
Output For each case, display the case number (they start with 1 and increase sequentially) and the equivalent fixed monthly interest rate Jill's mutual fund would have paid. Display this number with five fractional digits, rounded to the nearest decimal place. You may assume the interest rate will be no less than 0 and no larger than 1. Separate the output for consecutive cases by a blank line. Sample Input
Sample Output
|
[Submit] [Go Back] [Status] [Clarify]
All Copyright Reserved 2003
Any problem, Please Contact Administrator