Permutation formula with repeats is as follows

The number of different permutations of n objects, where there are n1 indistinguishable objects of style 1, n2 indistinguishable objects of style 2, ..., and nk indistinguishable objects of style k is:

n!/(n1!*n2!*...*nk!)

So for example, if i wanna order the letters of the CCSS they would be

4!/(2!*2!)=6

My questions is, given there are identical items and i want to arrange n items in groups of k, how can i genaralize a formula.

For example, i want to order arrange CCSS in groups of 2 (where order matters)

I know, the answer will be 4 (CC-CS-SC-SS) constructing all the outcomes, but is there a way to generalize these?

Thanks