calculate combinations of the items for the given capacity