No Change
시간 제한1초메모리 제한1024 MB
동전 값들이 주어질 때, 서로 다른 동전의 합으로 만들 수 없는 가장 작은 양의 금액을 구한다.
문제
Jack has coins, with values , , \dots, . Find the smallest positive amount that cannot be paid with these coins with no change.
입력
The first line contains (), the number of coins. The second line contains integers (), the values of the coins.
출력
The only line should contain a single positive integer: the smallest amount that Jack cannot pay with his coins.