Let us define a predicate
$$T(i,k_1,...,k_n)\in\{True, False\}$$
Where $T(i,k_1,...,k_n)$ means "using the $i$ first values of $S$, we can find $n$ disjoint subsets with sums $k_1, ... k_n$".
The answer you are looking for is $T(|S|,K,..,K)$ where $K$ appears $n$ times.
We have the following recurrence formula :
$$T(i,k_1,...,k_n) = \left\{
\begin{matrix}
T(i-1,k_1,...,k_n) & \text{// we don't use value $x_i$} \\
\vee T(i-1,k_1-x_i,...,k_n) \text{ if $x_i \geq k_1$} &\text{// we put value $x_i$ in set 1}\\
\vdots \\
\vee T(i-1,k_1,...,k_n-x_i) \text{ if $x_i \geq k_n$} &\text{// we put value $x_i$ in set n}\\
\end{matrix}\right.$$
This formula is a big boolean "or", I don't know how I could make it look better.
We also the following initialisation : $\forall i, T(i,0,...,0) = True$.
You can see it as a big $n+1$-dimensional array, where the first dimension has length $|S|$, and the others have length $K$, which gives $O(K^n|S|)$ values. In that array, all the values can be computed from the other values in time $O(n)$ (the big "or" is over $n+1$ values).
Therefore, the worst case complexity is $O(nK^n|S|)$.
About implementation, it might be easier to do with recursively with memorization. However, you're gonna blow up the stack really fast, so you might want to think of something iterative.
To get the actual values in each set, run a backtracking algorithm once you have that truth array.