Does the black box works in constant time? Is given? What other operations can you do, e.g., can you exchange two array elements? Can you run the black box on a part of the array? If yes, then is going to be the length of the part or of the whole array?
My idea is to set i = m, find the largest element and exchange it with the last element of the array. Then repeat the process with the first n - 1, n - 2, etc. elements.