def to_bins(x, borders):
    for i in range(len(borders)):
        if (x <= borders[i]):
            return i
    return len(borders)
def to_bins(x, borders):
    for i in range(len(borders)):
        if (x <= borders[i]):
            return i
    return len(borders)