import math


def nCr(n: int, r: int) -> float:
    """Computes nCr

    Args:
        n: Total number
        r: Number to sample

    Returns:
        nCr
    """
    if r > n or n < 0 or r < 0:
        return 0
    f = math.factorial
    return f(n) // f(r) // f(n - r)