| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 277 | 188 | 127 | 63.819% |
Amin works in the financial department of Divar company. As part of his responsibilities, he needs to prepare the salary payment list for the company’s employees. The salary of each employee is calculated based on a base hourly rate of $x$ Rials. However, the actual pay rate varies depending on the type of working hours:
Holiday hours always take precedence, and employees are compensated at the doubled rate for these hours, irrespective of the standard working hour limits.
Amin’s task is to calculate the total monthly salary for each employee, taking into account their normal hours, overtime hours, and holiday hours. Help Amin determine the payment for all the employees in the company.
The first line of input contains a single integer $n$ (1ドル \le n \le 1,円 000$), representing the number of employees in the company. The following $n$ lines each provide three integers $x,ドル $k$ and $h,ドル which describe the details for each employee:
In the output, print the total monthly payment for each employee on a separate line. The payment must be formatted with commas separating every three digits, starting from the right.
3 500 10 0 200 190 15 10000 150 20
5,000 44,500 1,700,000