It seems that the function max_element for vector would work for this purpose but I am not sure how to use it.
ForwardIterator max_element (ForwardIterator first, ForwardIterator last);
What is the type of ForwardIterator? How do I specify that it searches starting from the m-th element? And how do I find the index of the max element? Thanks.