Combination problem

Given an array of positive integers arr[900, 800, 700, 600, 500, 90, 80, 70, 60, 50, 9, 8, 7, 6, 5, 4, 3, 2, 1] anda sum 3400, find all unique combinations in the arr[] where the sum is equal to 3400. The same repeated number may be chosen from arr[] at most 5 times or thereafter x times-multiple(number), or excluded if not possible. Elements in a combination (a1, a2, …, ak) must be printed in non-descending order. (ie, a1 <= a2 <= … <= ak).
The combinations themselves must be sorted in ascending order, i.e., the combination with smallest first element should be printed first. If there is no combination possible the print “Empty” (without quotes).

Examples:

Input : arr[] = 2, 4, 5, 8
x = 10
Output : [2, 2, 2, 2,2]
[2, 4,4]
[4, 6]
[5,5]

the challenge in this problem how to list the outcome for the large sum when there is a small number like 2, 4 with repetition