#C4921. Average Duration Between Events

    ID: 48513 Type: Default 1000ms 256MiB

Average Duration Between Events

Average Duration Between Events

You are given a sequence of event timestamps in the format HH:MM:SS. Your task is to calculate the average time interval between consecutive events. Formally, if the timestamps are denoted as \( t_1, t_2, \ldots, t_n \) (in seconds), then you need to compute the average interval defined by

\[ \text{Average} = \left\lfloor \frac{\sum_{i=1}^{n-1}(t_{i+1} - t_i)}{n-1} \right\rfloor \]\

The result should be output in the HH:MM:SS format where hours, minutes, and seconds are zero-padded to two digits.

inputFormat

The input is read from stdin and is structured as follows:

  1. The first line contains an integer ( n ) (with ( n \ge 2 )), representing the number of events.
  2. The following ( n ) lines each contain a timestamp in the HH:MM:SS format.

The events are given in chronological order.

outputFormat

The output is written to stdout. It should contain a single line with the average duration between consecutive events in HH:MM:SS format.## sample

5
12:34:56
12:35:56
12:36:00
13:00:00
13:01:00
00:06:31