Vishal and His virtual girlfriend

0

0 votes
Easy
Problem

Vishal's virtual girlfriend has a wholesale business of statitionary items. She has designed a bot Ave to advice her to tell her the day when she will buy and sell a carton of magic pens.Ave has guessed the future price of items using machine learning. But Ave can't determine the day of buying and selling. Can you write a program for Ave, so that he will be able to determine the day for buying and selling, such that the profit for vishal's virtual girlfriend would be maximum. If there are multiple such days then print the first of such days.

Input:

First line would contain the number of days, n. Next line would contain n space separated integers A1, A2 .... , An denoting the price of item on the ith day.

Output:

Print two digits denoting the buying and selling day. Days start with 1. If there are no profit giving days then print -1 on buying day and -1 on selling day

Constraints:

2 ≤ N ≤ 105

1 ≤ Ai ≤ 109

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

Since the difference between 6th day and 4th day is maximum. So ave would chose the 4th day for buying and 6th day for selling.

Editor Image

?