Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Computers
Description 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 an Write a program that computes the minimum cost of having a computer over the Input The program input is from a text file. Each data set in the file stands for a particular set of costs. A data set starts with the cost White spaces can occur freely in the input. The input data are correct and terminate with an end of file. 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 Hint An input/output sample is shown above. There is a single data set. The cost for getting a new computer is - For the first computer, which is certainly bought:
*m(1,1)=5*,*m(1,2)=7*,*m(1,3)=50*, - For the second computer, in the event the current computer is replaced:
*m(2,2)=6*,*m(2,3)=8*, - For the third computer, in the event the current computer is replaced:
*m(3,3)=10*.
Source |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator