P27861 [洛谷] [NICA #2] College Entrance Examination Question Selection
普及
题目描述

Problem Description

The College Entrance Examination is a pivotal test that can determine the fate of each candidate. Therefore, Aya, who is responsible for assembling the exam papers, considers this task of utmost importance. Currently, Aya has $n$ potential questions for the exam.

For each potential question that could be included in the exam, there are $k$ indicators to evaluate various aspects of the question, such as difficulty, novelty, and relevance to real life. Each indicator is a positive integer.

Aya believes that the necessity of including a question in the exam is determined by the average of these indicators. He asserts that the two questions with the highest necessity must be included in the exam paper. If there are multiple questions with the top two necessity scores, the one that appears earlier is chosen. Please inform Aya which question must be included in the exam paper.

Input Format

The first line contains two positive integers $n, k$, as described in the problem.

Starting from the second line, there are $n$ lines, each containing $k$ positive integers separated by spaces. The $i$-th line represents the indicators of the $(i-1)$-th question.

Output Format

Output two lines, indicating which two questions have the top two necessity scores. Output the question with the highest necessity first; if there are multiple questions with the same necessity score, output the one that appears earlier first.

Sample Input and Output

Sample Input #1

3 2
10 20
15 25
20 30

Sample Output #1

3
2

Sample Input #2

3 2
10 20
5 25
1 2

Sample Output #2

1
2

Notes

The data guarantees that $2 \leq n \leq 100$, $1 \leq k \leq 10$, and $1 \leq$ each indicator of a question $\leq 100$.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3 2 10 20 15 25 20 30
样例输出
3 2