Ad Code

Responsive Advertisement

Uri - Beecrowd | 1051 | Taxes

beecrowd | 1051

Taxes

Adapted by Neilor Tonin, URI Brazil


In an imaginary country called Lisarb, all the people are very happy to pay their taxes because they know that doesn’t exist corrupt politicians and the taxes are used to benefit the population, without any misappropriation. The currency of this country is Rombus, whose symbol is R$.

Read a value with 2 digits after the decimal point, equivalent to the salary of a Lisarb inhabitant. Then print the due value that this person must pay of taxes, according to the table below.

Taxes 1051

Remember, if the salary is R$ 3,002.00 for example, the rate of 8% is only over R$ 1,000.00, because the salary from R$ 0.00 to R$ 2,000.00 is tax free. In the follow example, the total rate is 8% over R$ 1000.00 + 18% over R$ 2.00, resulting in R$ 80.36 at all. The answer must be printed with 2 digits after the decimal point.

Input

The input contains only a float-point number, with 2 digits after the decimal point.

Output

Print the message "R$" followed by a blank space and the total tax to be payed, with two digits after the decimal point. If the value is up to 2000, print the message "Isento".

Input Samples Outputs Samples

3002.00

R$ 80.36

1701.12

Isento

4520.00

R$ 355.60

N.B.: It's better if you solve this by your own. Thank you!


  URI - BEECROWD Online Judge 1051 Solve  in C :                                          

//Solved by Intesar
#include <stdio.h>

int main(){
    double sal;
    scanf("%lf", &sal);

    if(sal <= 2000.00){
        printf("Isento\n");
    }else if (sal >= 2000.01 && sal <= 3000.00){
          printf("R$ %.2f\n", (sal - 2000.00)*0.08);
    }else if (sal >= 3000.01 && sal <= 4500.00){
          printf("R$ %.2f\n", ((sal - 3000.00)*0.18 + 1000.00*0.08));
    }else if (sal >= 4500.01){
          printf("R$ %.2f\n", ((sal - 4500.00)*0.28 + 1500.00*0.18 + 1000.00*0.08));
    }
    return 0;
}

Post a Comment

0 Comments

Ad Code

Responsive Advertisement