Let set $S = \left \{ 1,2,3,4,5,6,\ldots,10,11,12 \right \}$.
Find how many sets are possible with a given sum and and upto given $m$.
For Ex : Take Sum = 6 and $m$ = size = $4$
The possible sets are : $\left \{ 2,4 \right \}, \left \{ 1,3,2 \right \}, \left \{ 1,4,1 \right \}, \left \{ 1,1,1,3 \right \}, \ldots$
but $\left \{ 1,1,1,1,2 \right \}$ is not valid as $m = 4$ and this contains $5$ elements
How many sets are possible with $m = 5$ and sum = $8$ ?
Is there any generalized idea to calculate sets ?