#P7189. [COCI 2007/2008 #6] PARKING
[COCI 2007/2008 #6] PARKING
Problem Description
Luka has graduated, and he found a job driving a truck.
One night, he parked trucks in a parking lot, with fees charged as follows:
- When truck is parked, the driver pays dollars per minute for each truck.
- When trucks are parked, the driver pays dollars per minute for each truck.
- When trucks are parked, the driver pays dollars per minute for each truck.
Given and the parking times of Luka's three trucks, determine how much Luka needs to pay.
Input Format
The first line contains , with meanings as described above.
The next three lines each contain numbers, representing the parking start time and end time of the -th truck. The -th minute is not charged.
Output Format
The first line contains one positive integer, indicating the amount of money Luka needs to pay.
5 3 1
1 6
3 5
2 8
33
10 8 6
15 30
25 50
70 80
480
Hint
Constraints
For of the testdata, , and .
Notes
- The full score for this problem is points.
- This problem automatically enables the O2 optimization switch.
- This problem is translated from COCI2007-2008 CONTEST #6 T1 PARKING, translated by https://www.luogu.com.cn/user/219791
Translated by ChatGPT 5