#P1288D. Minimax Problem
Minimax Problem
No submission language available for this problem.
Description
You are given arrays , , ..., ; each array consists of exactly integers. We denote the -th element of the -th array as .
You have to choose two arrays and (, it is possible that ). After that, you will obtain a new array consisting of integers, such that for every .
Your goal is to choose and so that the value of is maximum possible.
The first line contains two integers and (, ) — the number of arrays and the number of elements in each array, respectively.
Then lines follow, the -th line contains the array represented by integers , , ..., ().
Print two integers and (, it is possible that ) — the indices of the two arrays you have to choose so that the value of is maximum possible. If there are multiple answers, print any of them.
Input
The first line contains two integers and (, ) — the number of arrays and the number of elements in each array, respectively.
Then lines follow, the -th line contains the array represented by integers , , ..., ().
Output
Print two integers and (, it is possible that ) — the indices of the two arrays you have to choose so that the value of is maximum possible. If there are multiple answers, print any of them.