You should order the values of B in increasing order, such as:
value A=100
value B=50,10,20,5,15,20,30 => becomes
value B=5,10,15,20,20,30,50
This should make the Backtracking algorithm faster than a Brute-force search, because you can stop searching for suitable values of B as soon as the sum exceeds A.