Print all subsets of a set ($a$) of $n$ positive integers, such that the product of their elements equals $p$
Suppose the set is

$$a = \{2,3,6\} \cup \{5,7,35\} \cup \{11,13,143\} \cup \{17,19,323\} \cup \cdots \cup \{p_{2k-1},p_{2k},p_{2k-1}p_{2k}\}.$$

(Do you see the pattern?  It has $3k$ elements, composed of $k$ groups of three.  The $i$th group contains $p_{2i-1}$, the $2i-1$th prime, and $p_{2i}$, the $2i$-th prime, and their product.)

Also, suppose the product you want to hit is $p=p_1p_2 \cdots p_{2k}$.

Then this set has at least $2^k$ subsets that multiply to this value.  In particular, in each group, you can either pick the first two terms, or you can pick the third term.

So you'll need to output at least $2^k$ sets.  This means the running time on an input of size $3k$ can be as large as $2^k$.  Or, in other words, the running time on an input of size $n$ can be as large as $2^{n/3}$.  This is exponential in the length of the input.  Therefore, the worst-case running time is exponential. When we ask about the complexity, we usually implicitly mean the worst-case running time. Therefore, the complexity is exponential. Even though sometimes you might do much less work than that, sometimes you do fully exponential work, so we call the complexity exponential.

Unfortunately, I'm not aware of any simple rule of thumb that suffices for this case.  Sometimes you have to figure out what's going on, and that might require a more deep analysis.