Not representable number
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Given n positive integers. Find the minimum positive integer that is not representable as the sum of any of these numbers. Each original number cannot be included to the sum more than once.
Input
The first line contains the number n (1 ≤ n ≤ 10000), each of the following n lines contains one natural number if the range from 1 to 10^9
.
Output
Print the minimum not representable number.
Examples
Input #1
Answer #1
Submissions 2K
Acceptance rate 41%