How to write a given integer as sum of other integers?

105 Views Asked by At

Given are a set $S$ of random positive integers (not necassarily distinct) and another positive integer $x$. I look for an algorithm to find all possibilities to write $x$ as a sum of integers in $S$, but each integer in $S$ can only be used once. Can anybody help me?