Tax Calculation (Advanced)


Submit solution

Points: 1
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type

You are tasked to calculate income tax for your friend Waldo Weirado.

The Canadian 2024 federal income tax bracket works like the following:

Tax Bracket Tax Rate Income Range (CAD)
First Bracket 15% $0 – $55,867
Second Bracket 20.5% $55,867 – $111,733
Third Bracket 26% $111,733 – $173,205
Fourth Bracket 29% $173,205 – $246,752
Fifth Bracket 33% Over $246,752

Aside from federal tax, Waldo will also need to pay BC provincial tax:

Tax Bracket Tax Rate Income Range (CAD)
First Bracket 5.06% $0 – $47,937
Second Bracket 7.70% $47,937 – $95,875
Third Bracket 10.50% $95,875 – $110,076
Fourth Bracket 12.29% $110,076 – $133,664
Fifth Bracket 14.70% $133,664 – $181,232
Sixth Bracket 16.80% $181,232 – $252,752
Seventh Bracket 20.50% Over $252,752

BC also has a Basic Personal Income Tax credit of $12,580 which means Waldo doesn't have to pay provincial tax for $12,580 of his income. Assume he has income of $50,000, then he is tax at $50,000 - $12,580 = $37,420 on the provincial level.

A similar measure also exists at the federal level, that amount is $15,705.

Given an individual's income, you will need to calculate exactly how much they have to pay the federal and provincial taxman .

Input Specification

The first line contain a single integer number \(N\) (\(N<1000\)), indicating Waldo's annual income amount.

Output Specification

The first line should contain a single number accurate to 2 digits after the decimal point, which is the total amount of federal tax one has to pay.

The second line should contain a single number accurate to 2 digits after the decimal point, which is the total amount of provincial tax one has to pay.

The third line should contain another number, which represents the total percentage of one's income that's paid to the taxman. This is called the effective tax rate.

Sample Input

97009

Sample Output

13594.63
5235.50
0.19

Explain

Federal Taxable Amount:    97009 - 15705 = 81304
Provincial Taxable Amount: 97009 - 12580 = 84429
Federal Tax: 15% * 55867 + 20.5% * (81304-55867) = 13594.63
Provincial Tax: 5.06% * 47937 + 7.7% * (84429 - 47937) = 5235.50

Comments

There are no comments at the moment.