Divar’s Salaries

시간 제한1초메모리 제한2048 MB

요약
직원마다 기본 시급, 140시간 기준, 1.5배 초과근무, 2배 휴일근무를 반영해 월급을 계산하고 세 자리마다 쉼표를 넣어 출력한다.
난이도

쉬움10점 중 3점

유형
수학, 구현
정답자
아직 제출이 없습니다

문제

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 xx Rials. However, the actual pay rate varies depending on the type of working hours:

  • Normal Working Hours: Paid at the standard rate of xx Rials per hour.
  • Overtime Hours: Any hours worked beyond the standard 140140 hours per month are compensated at 1.51.5 times the base rate.
  • Holiday Hours: Hours worked on recognized holidays are paid at twice the base rate, regardless of whether they fall within or beyond the standard 140140 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 nn (1≤n≤1,0001 \le n \le 1\\, 000), representing the number of employees in the company. The following nn lines each provide three integers xx, kk and hh, which describe the details for each employee:

  • xx (100≤x≤106100 \le x \le 10^6): The hourly wage in Rials, which is always a multiple of 1010.
  • kk (0≤k≤4800 \le k \le 480): The total number of hours worked during the current month.
  • hh (0≤h≤k0 \le h \le k): The number of holiday hours worked.

출력

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.

예제1

  1. 예제 1

    입력
    3
    500 10 0
    200 190 15
    10000 150 20
    
    예상 출력
    5,000
    44,500
    1,700,000