Here I am just putting python code.
Rec(Arr,N,K,X) :
if(X==0 and K==0):
return 1
elif(X<=0 or K<=0 or N<0):
return 0
else :
return Rec(Arr,N-1,K,X)+Rec(Arr,N,K-1,X-Arr[N])
Provided that all element of Arr are distinct,this conclude that all sub problems are non-overlapping(just took an small case, do it manually)
Please Evaluate Time Complexity in terms of N,K,X. Thanks for reading this question...