#K40532. Apartment Water Usage Analysis

    ID: 26663 Type: Default 1000ms 256MiB

Apartment Water Usage Analysis

Apartment Water Usage Analysis

In this problem, you are given the water usage data for multiple apartments over several months. Your task is to compute the apartment with the highest total water consumption. For each apartment \(i\), the total water usage is calculated as:

$$S_i=\sum_{j=1}^{m} a_{ij},$$

where \(a_{ij}\) is the water usage in the \(j^{th}\) month. If there is a tie, output the apartment with the smallest index (1-indexed).

inputFormat

The first line contains two integers \(n\) and \(m\), where \(n\) is the number of apartments and \(m\) is the number of months. This is followed by \(n\) lines, each containing \(m\) space-separated integers, representing the water usage data for each apartment over \(m\) months.

outputFormat

Output a single integer representing the 1-indexed apartment that has the highest total water usage.

## sample
3 4
10 20 30 40
50 60 70 80
90 10 20 30
2