One day, Mike wanted to buy a birthday gift for his friend Judy. At that time, his wallet contained four kinds of banknotes (i.e., banknotes with denominations of $1, $3, $5, and $10), and the number of each banknote is a, b, c, and d, respectively. If he needs to pay n dollars to buy the birthday gift, can he pay successfully without making change? If the payment is successful (without change), please calculate the number of payment methods; if the payment is unsuccessful (with change), please output "no".
Write a program that reads a string of positive integers (i.e., a, b, c, d, n, where data type: int, with spaces between integers) as input and outputs the number of successful payment methods or "no".
[Example]
Suppose Mike has $1, $3, $5, and $10 each (i.e., a=b=c=d=1) and he wants to buy a birthday gift worth $15 (n=15). As a result, he can pay successfully without making change, and he has only one payment method, namely one $5 and one $10.
[Hint]
You can use a nested loop structure to enumerate all possible cases.
Sample Input and Output
The program reads the number of $1, $3, $5, $10 banknotes as well as the gift price sequentially, i.e., a, b, c, d, n.
Example 1: Please enter five integer numbers: 11111
Example 2: Please enter five integer numbers: 1 2 3 4 15
Output: 2
Example 3: Please enter five integer numbers: 1 1 1 1 100
Output: "no"
Example 4: Please enter five integer numbers: 5 2 3 4 15
Example 5: Please enter five integer numbers: 5 6 4 4 25
Output: 18