#C11988. Maximum Average Row in CSV Data

    ID: 41364 Type: Default 1000ms 256MiB

Maximum Average Row in CSV Data

Maximum Average Row in CSV Data

You are given a CSV (comma-separated values) data where each line represents a row of numerical values. Your task is to determine the row number (1-indexed) that has the highest average value.

The average of a row is defined as

\(\text{average} = \frac{\text{sum of values}}{\text{number of values}}\)

If multiple rows have the same maximum average, output the smallest row number among them.

inputFormat

The input is read from standard input (stdin) and consists of a CSV formatted string. Each row is on a separate line and the numbers in each row are separated by commas.

outputFormat

Output to standard output (stdout) a single integer representing the 1-indexed row number which has the maximum average value.

## sample
1,2,3
4,5,6
7,8,9
10,11,12
4