Alex is a student at a collage and will now enroll in the summer semester, for which he needs to take paper documents to the faculty. All students bring their documents on one of the N days (marked from 1 to N) that are provided for it. From the enrollments of previous years, for each of the N days it is known what is the expected number of students who will take the documents that day. Alex will bring the documents on the day when the least number of students are expected to bring documents on that day, and if there are more such days - then on the first possible day. Print on which of the days Alex will bring the documents and how many students are expected to go to the college on that day.
Input In the first row is the number N (1 ≤ N ≤ 30), the number of days provided for carrying documents. The next row contains N integers in the range 1 to 1000, the number of students expected to attend college on each of the N days, starting with day one
Output On one line, print the sequence number of the day Alex chooses, followed by the number of students expected to attend college on that day.
Examples
#1
Input 3 30 20 40 Output 2 20
#2
Input 4 20 30 40 20 Output 1 20
I can find the min number,but im now sure on how to get the position of the array and choose the first one if values repeat
int arr[1000],n,i,min;
cin>>n;
for (int i = 0; i < n; ++i)
cin>>arr[i];
min = arr[0];
for (i = 0; i < n; i++)
{
if (min > arr[i])
min = arr[i];
}
cout<<min;