There is one important point - We can pick any element any number of times but the total picked element should be equal to K.
For example - If set of elements is 1 2 3 5 and K = 3 and X = 4.
Then answer is 1 because there is only one way to pick 3 elements which adds upto 4 and those 3 elements are two 1's and one 2. (1+1+2 = 4)
An algorithm can greatly help. :)