ATM
Easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
In some country in circulation there are notes of certain denominations. National Bank wants the cash machine to give out any requested amount with a minimum number of banknotes, considering that the amount of banknotes of each denomination is unlimited.
Help the National Bank to solve this problem.
Input
First line contains the number of banknotes denominations in circulation . Second line contains different positive integers not greater than - the banknotes denominations. Third line contains the sum that you want to give.
Output
Print in the first line the minimal number of summands (or if such representation does not exist). In the second line print these summands in any order.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 19%