PivotOJ

Stopwatch

시간 제한: 1000ms메모리 제한: 1024MB출처: ICPC Rocky Mountain Regional 2020BOJ 21197

문제

Robin just received a stopwatch from her grandfather. Robin's stopwatch has a single button. Pressing the button alternates between stopping and starting the stopwatch's timer. When the timer is on, the displayed time increases by 1 every second.

Initially the stopwatch is stopped and the timer reads 0 seconds. Given a sequence of times that the stopwatch button is pressed, determine what the stopwatch's timer displays.

입력

The first line of input contains a single integer NN (1N10001 \leq N \leq 1\,000), which is the number of times the stopwatch was pressed.

The next NN lines describe the times the stopwatch's button was pressed in increasing order. Each line contains a single integer tt (0t1060 \leq t \leq 10^6), which is the time the button was pressed. No two button presses happen on the same second.

출력

Display still running if the stopwatch's timer is still running after all button presses were made. Otherwise display the number of seconds displayed on the stopwatch's timer.

예제

예제 1

입력
2
7
11
출력
4

예제 2

입력
5
2
5
9
10
17
출력
still running

예제 3

입력
4
0
2
104
117
출력
15
코드를 제출하려면 로그인하세요.