avg_salary = F_avg_salary_yinyong()
# total_salary = F_YearToDate('P0012',12,0)
if CPS0001>=avg_salary*3.0:
the_base = CPS0001-avg_salary*3.0
else:
the_base = 0
if the_base <= 36000:
the_rate = 3.0
to_div = 0
elif 36000<the_base <=144000:
the_rate = 10.0
to_div = 2520.0
elif 144000<the_base <=300000:
the_rate = 20.0
to_div = 16920.0
elif 300000<the_base <=420000:
the_rate = 25.0
to_div = 31920.0
elif 420000<the_base <=660000:
the_rate = 30.0
to_div = 52920.0
elif 660000<the_base <=960000:
the_rate = 35.0
to_div = 85920.0
elif the_base>960000:
the_rate = 45.0
to_div = 181920.0
result = the_base*the_rate/100.0-to_div