E. Bus Video System
time limit per test1 second
memory limit per test256 megabytes
inputstandard input
outputstandard output
The busses in Berland are equipped with a video surveillance system. The system records information about changes in the number of passengers in a bus after stops.
If
x
is the number of passengers in a bus just before the current bus stop and
y
is the number of passengers in the bus just after current bus stop, the system records the number
y
−
x
. So the system records show how number of passengers changed.
The test run was made for single bus and
n
bus stops. Thus, the system recorded the sequence of integers
a
1
,
a
2
,
…
,
a
n
(exactly one number for each bus stop), where
a
i
is the record for the bus stop
i
. The bus stops are