Given a positive integer X, how can one partition it into N parts, each between A and B where A <= B are also positive integers? That is, write

X = X_1 + X_2 + ... + X_N

where A <= X_i <= B and the order of the X_is doesn't matter?

Edit
Report