You are given n arrays, each consisting of m integers. You need to choose two arrays, ai and aj, such that the value of min_k=1^m bk is maximized, where bk=max(ai,k,aj,k).
The input consists of the following:
-
The first line contains two integers
nandm(1≤n≤3×10^5, 1≤m≤8) — the number of arrays and the number of elements in each array, respectively. -
Then,
nlines follow, where thex-th line contains the arrayaxrepresented bymintegersax,1,ax,2, ...,ax,m(0≤ax,y≤10^9).
Print two integers i and j (1≤i,j≤n, it is possible that i=j) — the indices of the two arrays you have to choose so that the value of min_k=1^m bk is maximum possible. If there are multiple answers, print any of them.
- 1≤n≤3×10^5
- 1≤m≤8
- 0≤ax,y≤10^9
6 5 5 0 3 1 2 1 8 9 1 3 1 2 3 4 5 9 1 0 3 7 2 3 0 6 3 6 4 1 7 0
1 5
The End!