Coins 2
시간 제한2초메모리 제한512 MB
1부터 n까지의 동전이 각각 주어진 개수만큼 있을 때, 일부를 사용해 거스름돈 없이 만들 수 있는 음이 아닌 정수 값의 가짓수를 센다.
문제
In ICPCCamp, people usually use coins of values .
Bobo was very poor, he had only coins of values , respectively. He bought an item of an unknown value without making change.
The unknown item was of non-negative integer value. Find the number of possible values it may have had.
입력
The input contains zero or more test cases, and is terminated by end-of-file. For each test case:
The first line contains one integer ().
The second line contains integers ().
It is guaranteed that the number of test cases does not exceed , and there is at most one test case where .
출력
For each test case, output an integer which denotes the number of possibilities.