#K77522. Maximum Bus Stops on a Round Trip

    ID: 34883 Type: Default 1000ms 256MiB

Maximum Bus Stops on a Round Trip

Maximum Bus Stops on a Round Trip

You are given multiple test cases. For each test case, the first line contains an integer \(N\) representing the number of routes. The next line contains \(N\) space-separated integers where each integer represents the number of bus stops on that particular route. Your task is to compute the total number of bus stops for each round trip, which is simply the sum of the bus stops for all the routes in the test case.

The input is terminated by a test case where \(N = 0\); this test case should not be processed. For each valid test case, print the computed sum on a new line.

Note: All formulas are provided in LaTeX format. For example, the number of routes is given by \(N\) and the stops by \(s_1, s_2, \ldots, s_N\). The answer for each test case is \(\sum_{i=1}^{N} s_i\).

inputFormat

The input consists of several test cases. Each test case begins with an integer (N) ((N \geq 1)), followed by a line with (N) space-separated integers representing the number of bus stops on each route. Input terminates with a test case where (N = 0); this test case should not be processed.

outputFormat

For each test case, output a single line containing the total number of bus stops in the round trip. The output should be printed to standard output (stdout).## sample

4
1 2 3 4
3
5 9 2
5
1 1 1 1 1
0
10

16 5

</p>