def income_tax(wage):
    """
    :param wage: 到手的月收入

    个税速算：全月应纳税所得额(Taxable Income) × 适用税率(Tax Rate) - 速算扣除数(Quick Deduction)

    #       Ti     Tr    Qd
    -----------------------
    1      ~1500   3%     0
    2  1500~4500  10%   105
    3  4500~9000  20%   555
    4  9000~35000 25%  1005
    5 35000~55000 30%  2755
    6 55000~80000 35%  5505
    7 80000~      45% 13505
    """
    quick_deductions = (
        (0.00000, 0.03, 0.00000),  # 1
        (1500.00, 0.10, 105.000),  # 2
        (4500.00, 0.20, 555.000),  # 3
        (9000.00, 0.25, 1005.00),  # 4
        (35000.0, 0.30, 2755.00),  # 5
        (55000.0, 0.35, 5505.00),  # 6
        (80000.0, 0.45, 13505.0),  # 7
    )
    threshold = 3500  # 起征点
    taxable_income = wage - threshold  # 应缴税工资
    if taxable_income <= 0:
        return 0
    level = 6
    for index, i in enumerate(quick_deductions):
        if taxable_income < i[0]:
            level = index - 1
            break
    return taxable_income * quick_deductions[level][1] - quick_deductions[level][2]