BETA
Number of combinations for a given sum (with restriction)

Let's take Keno for example:

There are C(80,20) = 3,535,316,142,212,174,320 ways the casino can draw 20 numbers range from 1 to 80.

Given that the sum of the 20 numbers($x) drawn is $n, the conditions are as below:

  • 1 <= $x <= 80
  • $x1 + $x2 + $x3 ... + $x20 = $n
  • $x1, $x2, $x3 ... $x20 are distinct

Eg. If $n = 210, which is the minimum sum, 1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20 = 210. Therefore, there is only one possible combination for the sum of 20 numbers to be 210.

Input: $n = 210

Output : 1

Author: LimSY
Login to Answer
Sort By:
Oldest
|
Newest
|
Vote
|
My Answer