Which m numbers in the range [1, k] have sum equal to n
Hint:


What is the smallest number that can be represented as the sum of $m$ distinct integers from $1$ to $k$?
What is the largest number that can be represented as the sum of $m$ distinct integers from $1$ to $k$?
Can all numbers in between be so represented?