17 lines
367 B
Text
17 lines
367 B
Text
// working with 9988 choose 14
|
|
//
|
|
def fac(x):
|
|
f = 1
|
|
counter = 0
|
|
for i in 1..20000 do
|
|
f = if counter == x then f else f * i fi
|
|
counter = if counter == x then counter else counter + 1 fi
|
|
endfor
|
|
return f
|
|
def main(n, k):
|
|
top = fac(n)
|
|
bot1 = fac(k)
|
|
sub = n - k
|
|
bot2 = fac(sub)
|
|
bot = bot1 * bot2
|
|
return top / bot
|