#C2428. Payroll Calculation
Payroll Calculation
Payroll Calculation
You are given data for n employees. For each employee, you are provided with the employee's name, hourly rate, and the number of hours worked in a payroll period. The total pay for an employee is calculated as follows:
If the number of hours worked is \( h \) and the hourly rate is \( r \), then:
\( \text{Total Pay} = \begin{cases} r \times h, & \text{if } h \leq 40, \\ r \times 40 + (h - 40) \times (1.5 \times r), & \text{if } h > 40. \end{cases} \)
Your task is to compute the total pay for each employee and print the result on a separate line in the format:
name total_pay
The total_pay
should be formatted to exactly two decimal places.
inputFormat
The input is read from standard input (stdin) and has the following format:
- The first line contains a single integer \( n \) representing the number of employees.
- The following \( n \) lines each contain three items: the employee's name (a string), hourly rate (an integer), and the number of hours worked (an integer), separated by spaces.
outputFormat
Output the total payroll for each employee on a separate line. Each line should contain the employee's name followed by a space and the total pay formatted with two decimal places.
## sample1
Alice 25 38
Alice 950.00
</p>