With unlimited gems of each of N kinds, list all total values obtainable by choosing exactly K gems.
A thief broke into a jewelry store. The thief wants to carry off exactly KKK gems.
The store stocks NNN kinds of gems. Gems of kind iii are worth aia_iai each, and every kind is available in unlimited supply.
Write a program that finds every total value the thief can carry off.
The first line contains NNN and KKK. (1≤N,K≤10001 \le N, K \le 10001≤N,K≤1000)
The second line contains a1,a2,…,aNa_1, a_2, \dots, a_Na1,a2,…,aN separated by spaces. (1≤ai≤10001 \le a_i \le 10001≤ai≤1000) The same value may appear more than once.
Print every reachable total value on one line in ascending order. Separate two consecutive totals with a single space. Print each total only once.