Олимпиадный тренинг

Задача 23333. Checkout (D, C')


Задача

Темы:
Olya decided to become an entrepreneur, and recently opened her own store "N-Audio". The store has been open for n whole days, and at the end of each day Olya comes and writes down the amount of money in the store's cash register on a piece of paper. At the same time, at the end of the day, money is not withdrawn from the cash register,   that is, after the first day, the proceeds for the first day are stored in the cash desk, after the second day, the proceeds for the first and second days, and so on. Olya wondered which of the n days the store's revenue was the highest. If there are several such days, Olya is interested in the first such day.

Input data format  
the  first line of the input file contains an integer n - the number of days during which
shop 1 <= n <= 105 was open. The i-th of the next n lines contains an integer ai -
description of the balance of rubles at the cash desk of the store after the i-th day 0 <= ai <=109
it is guaranteed that money has never been taken from the cash register, i.e. ai > ai?1 -  for any i from 2 to n.
 
Output format
In the only line of the output file print two integers - the number of the day in which
the store's revenue was maximum, and the value of this revenue. If there are several such days, then
print the earliest one. Days in the store are numbered from one?

Enter Output
3
4
5
17
3 12
5
1
1
3
5
5
3 2