Recently I came across a question related to combinatorics where you had to find all the number of ways to distribute a particular sum(N) into 3 numbers(different or same) such that the combined sum of these numbers is N and each of the chosen number is less than or equal to a given number(K)?? Anyone has any idea how to solve this problem??