#K32802. Calculate Customer Rides

    ID: 24946 Type: Default 1000ms 256MiB

Calculate Customer Rides

Calculate Customer Rides

You are given a dataset containing information about customers and the rides they took. Each customer has a record which includes one extra number at the beginning that should be ignored, followed by M numbers representing the number of rides taken for different purposes. Your task is to calculate the total number of rides for each customer by summing up the ride counts excluding the first integer in each record.

The input begins with three integers: N (the number of customers), M (the number of rides per customer), and K which is a parameter that is not used in the calculations. This is followed by N lines (or segments) where each segment has M + 1 integers. For a given customer i, if the corresponding rides array is represented as

$$[a_{i0}, a_{i1}, a_{i2}, \dots, a_{iM}]$$

then the total rides for that customer is computed by:

$$Total_i = \sum_{j=1}^{M} a_{ij}$$

Output the total rides for each customer, one per line.

inputFormat

The input is read from stdin and consists of space-separated integer values. The first three integers are N, M, and K. This is followed by exactly N × (M + 1) integers, representing the rides information for each customer.

For example, a sample input can be:

3 4 2 1 3 2 1 4 2 5 6 3 1 3 2 4 6 1

outputFormat

For each customer, output a single line containing the sum of the rides (ignoring the first number in their record) on stdout.

For the example above, the output should be:

10
15
13
## sample
3 4 2 1 3 2 1 4 2 5 6 3 1 3 2 4 6 1
10

15 13

</p>