| 3836 - Computers Europe - Southeastern - 2007/2008 | |||||
| Submit | Ranking | ||||
Everybody is fond of computers, but buying a new one is always a money challenge. Fortunately, there is always a convenient way to deal with. You can replace your computer and get a brand new one, thus saving some maintenance cost. Of course, you must pay a fixed cost for each new computer you get.
Suppose you are considering a n
Write a program that computes the minimum cost of having a computer over the n
The program prints the minimum cost of having a computer throughout the n
White spaces can occur freely in the input. The input data are correct and terminate with an end of file.
An input/output sample is in the table below. There is a single data set. The cost for getting a new computer is c = 3
The result for the data set is the minimum cost 19.
y
n
n
Input
The program input is from the standard input. Each data set in the file stands for a particular set of costs. A data set starts with the cost c
Output
For each set of data the program prints the result to the standard output from the beginning of a line.
Sample Input
3
3
5 7 50
6 8
10
Sample Output
19
Southeastern 2007-2008