#K81487. Calculate Net Salary

    ID: 35764 Type: Default 1000ms 256MiB

Calculate Net Salary

Calculate Net Salary

You are given an employee's base salary and an indicator specifying whether the employee met the targets. If the employee met the targets (indicated by 'Y'), they receive a bonus of 10% of their base salary. Otherwise, no bonus is awarded.

The tax rate is determined based on the following salary slabs:

  • If \( base\_salary \le 50000 \), the tax rate is \(10\%\) (i.e., \(0.1\)).
  • If \( 50000 < base\_salary \le 100000 \), the tax rate is \(20\%\) (i.e., \(0.2\)).
  • If \( base\_salary > 100000 \), the tax rate is \(30\%\) (i.e., \(0.3\)).

The net salary is computed using the formula:

\( net\_salary = base\_salary + bonus - (tax\_rate \times base\_salary) \)

Print the net salary as an integer (using integer truncation if necessary).

inputFormat

The input is read from standard input and consists of two lines. The first line contains an integer representing the base salary. The second line contains a single character ('Y' if the employee met their targets or 'N' otherwise).

outputFormat

Output a single integer representing the net salary after applying the bonus (if any) and deducting the tax.## sample

40000
N
36000