| CodeRams Practice Problem Archive |
|---|
| Finished |
You have a list of $$$n$$$ books. You want to read one complete book, but you want to read as few pages as possible. You're given the list of how many pages each book has. Figure out the minimum number of pages that you have to read, reading at least one complete book.
The first line of input contains a positive integer $$$n$$$: the number of books. The next line contains $$$n$$$ space-separated integers: the number of pages of each book.
Output a single positive integer $$$p$$$: the minimum number of pages that you have to read, if you read at least one complete book.
5 179 173 275 865 180
173
5 500 450 300 299 100
100
| Name |
|---|


