Is there any wrong in the question SLAB in february cookoff?

Example Input

2
600000
250000

Example Output

577500
250000

I think there is some wrong in the output.
As a result of input 600000, the output should be 575000
because, as the description of the problem,
the tax slab for 600000 should be r=((750000-500000)*0.1)=25000
so, neat earn should be 575000. I think i have a mistake somewhere.
Please tell me.

See the example given.

Please read the explanation of the question you will understand it.On first try I was also thinking like you so reading of explanation is important.

1 Like

for the first 250000, the tax is 0%, hence you have to exclude that amount from total.

1 Like

But how can output is 577500 for the input 600000?

try thinking of slab widths, till 250000 there is no tax, for the slab of 5L to 2.5L the tax is 5% i.e. slab width is 250000 therefore tax is 12500 (250000 * 0.05), now for next slab tax is 10%, therefore, 600000 - 500000 = 100000 is slab width, so tax is 10000(100000 * 0.1),.
therefore total tax is 22500, and 600000 - 22500 = 577500.

1 Like

Now, I understand. Thanks.