#C11685. Total Review Time Calculation
Total Review Time Calculation
Total Review Time Calculation
You are given a series of intervals. Each interval represents the start and end time for reviewing a submission. Your task is to calculate the total review time by summing up the duration of each interval.
Each interval is defined by two integers, \(s\) and \(e\), and the duration of an interval is \(e - s\). The input will first provide an integer \(n\) representing the number of intervals, followed by \(n\) lines each containing two integers \(s\) and \(e\). Compute the total review time as: \[ \text{Total Time} = \sum_{i=1}^{n} (e_i - s_i) \]
Ensure your program reads from standard input and writes to standard output.
inputFormat
The input is given via standard input and consists of:
- The first line contains a single integer \(n\), the number of intervals.
- Each of the next \(n\) lines contains two space-separated integers representing the start time and end time of a submission.
outputFormat
Output a single integer which is the total review time, computed as the sum of differences \(e - s\) for all intervals.
## sample3
1 4
5 6
8 10
6
</p>