You are given two integers $N$ and $K$. Find all ways to represent $N$ as the sum of exactly $K$ distinct positive integers $x_1,x_2, \ldots,x_K$ — in other words.
$xi_>0$ for each valid $i$;
$x_i \neq x_j$ for each valid $i \neq j$;
$x_1+x_2+ \ldots +x_K=N$
For Example : $N=15$ and $K=3$
Answer should be: $1+2+12, 1+3+11, 1+4+10, 1+5+9, 1+6+8, 2+3+10, 2+4+9, 2+5+8, 2+6+7, 3+4+8, 3+5+7, 4+5+6$
How to code to generate these combinations in any language?
Are you currently participating in SnackDown Round 1B, Then you should not ask this question before the competition ends, you are violating the codechef code of conduct for the competition.