def cal_electbill(units):
    if units <= 100:
        return units * 3.50
    elif units <= 200:
        return 100 * 3.50 + (units - 100) * 4.00
    elif units <= 300:
        return 100 * 3.50 + 100 * 4.00 + (units - 200) * 5.00
    else:
        return 100 * 3.50 + 100 * 4.00 + 100 * 5.00 + (units - 300) * 6.00