def apply_polynomial(coeff, x):
    """Given coefficients [a0, a1, ..., an] and x, compute f(x) = a0 + a1*x + ... + ai*x**i +
    ... + an*x**n.

    Args:
        coeff (list(int)): Coefficients [a0, a1, ..., an].
        x (int): Point x to on which to evaluate the polynomial.

    Returns:
        int: f(x) = a0 + a1*x + ... + ai*x**i + ... an*x**n.
    """
    f = 0
    xi = 1
    for ai in coeff:
        f += ai * xi
        xi *= x
    return f