← 返回 doordash 的题目列表Dasher Pay with Peak-Hour Multiplier
类型:online_judge
Problem: Calculate Dasher Pay with Peak-Hour Multiplier
DoorDash needs to calculate the total pay for a Dasher in one day.
You are given:
Several working intervals [start, end), measured in minutes from the start of the day.
A base pay rate base, in cents per minute.
Several peak-hour intervals [start, end), each with a multiplier_percent. For example, 200 means double pay and 150 means 1.5x pay.
Rules:
All intervals are half-open: [start, end).
Working time inside a peak interval is paid using that peak multiplier.
Working time outside all peak intervals is paid at 100% base rate.
If multiple peak intervals overlap, use the highest multiplier.
Working intervals do not overlap.
Output the total pay in cents, rounded down.
Input Format
n m base
work_start_1 work_end_1
...
work_start_n work_end_n
peak_start_1 peak_end_1 multiplier_percent_1
...
peak_start_m peak_end_m multiplier_percent_m
Output Format
total_pay_in_cents
Constraints
1 <= n, m <= 2 * 10^5
0 <= start < end <= 1440
1 <= base <= 10^5
100 <= multiplier_percent <= 1000
Example
Input:
1 1 100
60 180
120 150 200
Output:
15000
Example
Input
1 1 100
60 180
120 150 200
Output
15000