def diffs_stats(pairs):
    """returns the avg and the maximum difference between the given pairs and
    the count of cases where the first element is bigger than the second
    """
    s = 0.0
    m = 0.0
    n = 0
    for (old, new) in pairs:
        d = new - old   # not using abs here on purpose
        s += d
        if new < old:
            n += 1
        if abs(d) > abs(m):
            m = d
    return s / len(pairs), m, n