Using the formula for the sum of the squares and the sum of first $K$ numbers I can get that: $$\sum_{k=1}^{K}(N-k)(k+1)^2=\dfrac{1}{12}K(-3K^2+2K^2(2N-7)+3K(6N-7)+26N-10)$$
Now I guess I can simplify the formula if I would like to get the big-O. I think for $N=K$, it is fine for me. $$O(K^4).$$
What about $N>K$ and $N<K$ ?