There are
Person
In a rush of generosity, administration decided to introduce happy hour i.e. interval of continuous
Input Specification
First line contains integers
Next
Output Specification
Print the required sum in a single line.
Scoring
Subtask | Points | Constraints |
---|---|---|
Sample Input 1
5 3 4
2 1 4
3 3 7
3 3 8
1 5 7
5 3 8
Sample Output 1
7
Explanation for Sample Output 1
Happy hour will span from 4th until the 7th minute. Inside that interval, first person should've paid extra for the 4th minute and second, third and fourth person should've paid for 6th and 7th minute.
Sample Input 2
3 2 22
7 16 33
69 14 88
8 10 97
Sample Output 2
27
Comments