If the answer is yes, different pies would be counted differently: You have 12 pies, and you randomly select which place you are going to deliver them to. There are 3 choices for each pie and so there are $3^{12}=531441$ ways of doing that.
If the pies are interchangeable, then this is harder, unless you know the formula! To distribute N items to M bins: $\mathbf{C}^{N+M-1}_{N} = {17 \choose 12}=\frac{17!}{12!\cdot 5!}=6188$