Codeforces Round 312 (Div. 2)
B
Amr and The Large Array
Codeforces
1300
原题
← AC →
翻译中…

Amr has got a large array of size $*n*$. Amr doesn't like large arrays so he intends to make it smaller.

翻译中…

Amr doesn't care about anything in the array except the beauty of it. The beauty of the array is defined to be the maximum number of times that some number occurs in this array. He wants to choose the smallest subsegment of this array such that the beauty of it will be the same as the original array.

翻译中…

Help Amr by choosing the smallest subsegment possible.

翻译中…

Input

翻译中…

The first line contains one number $*n*$ ($1 ≤ *n* ≤ 10^{5}$), the size of the array.

翻译中…

The second line contains $*n*$ integers $*a*_{*i*}$ ($1 ≤ *a*_{*i*} ≤ 10^{6}$), representing elements of the array.

翻译中…

Output

翻译中…

Output two integers $*l*, *r*$ ($1 ≤ *l* ≤ *r* ≤ *n*$), the beginning and the end of the subsegment chosen respectively.

翻译中…

If there are several possible answers you may output any of them.

翻译中…

Note

翻译中…

A subsegment $*B*$ of an array $*A*$ from $*l*$ to $*r*$ is an array of size $*r* - *l* + 1$ where $*B*_{*i*} = *A*_{*l* + *i* - 1}$ for all $1 ≤ *i* ≤ *r* - *l* + 1$

翻译中…

样例

Input #1
5
1 1 2 2 1
Output #1
1 5
InputCopy OutputCopy
Input #2
5
1 2 2 3 1
Output #2
2 3
InputCopy OutputCopy
Input #3
6
1 2 2 1 1 2
Output #3
1 5
InputCopy OutputCopy
题目信息
题号
558B
时间限制
1 s
内存限制
256 MB
标签
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。