Divar's Salaries
Time limit1sMemory limit2048 MB
Computes each employee's monthly pay from wage x, total hours k, and holiday hours h, using 1.5x for hours past 140 and 2x for holiday hours.
- Level
Easy2 of 10
- Topics
- Implementation, Math
- Solved
- No attempts yet
Problem
Amin works in the financial department of Divar company. As part of his job, he prepares the salary payment list for the company's employees. Each employee's salary is calculated from a base hourly rate of Rials. However, the actual pay rate depends on the type of working hours.
- Normal working hours: Paid at the standard rate of Rials per hour.
- Overtime hours: Hours worked beyond the standard 140 hours per month are paid at 1.5 times the base rate.
- Holiday hours: Hours worked on recognized holidays are paid at twice the base rate, whether they fall within or beyond the standard 140 hours.
Holiday hours take precedence. Those hours are paid at the doubled rate regardless of the standard working hour limits.
Amin must calculate the total monthly salary for each employee, counting normal hours, overtime hours, and holiday hours.
Input
The first line contains a single integer (), the number of employees. Each of the following lines contains three integers , , and describing one employee.
- (): The hourly wage in Rials. It is always a multiple of 10.
- (): The total number of hours worked this month.
- (): The number of holiday hours worked.
Output
For each employee, print the total monthly payment on a separate line. Separate every three digits with commas, starting from the right.