diff --git a/T.py b/T.py new file mode 100644 index 0000000..1253604 --- /dev/null +++ b/T.py @@ -0,0 +1,12 @@ +import sys +sys.setrecursionlimit(10**9+7) +def fact(x): + if x == 0: + return 1 + return x * fact(x - 1) +n, r = map(int, input().split()) +r = min(r, n - r) # optimization +if r < 0: + print(0) +else: + print(fact(n) // (fact(r) * fact(n - r))) \ No newline at end of file