Good Bye 2019
B
Interesting Subarray
Codeforces
1200
原题
← AC →
翻译中…

For an array $a$ of integers let's denote its maximal element as $\max(a)$, and minimal as $\min(a)$. We will call an array $a$ of $k$ integers interesting if $\max(a) - \min(a) \ge k$. For example, array $[1, 3, 4, 3]$ isn't interesting as $\max(a) - \min(a) = 4 - 1 = 3 \lt 4$ while array $[7, 3, 0, 4, 3]$ is as $\max(a) - \min(a) = 7 - 0 = 7 \ge 5$.

翻译中…

You are given an array $a$ of $n$ integers. Find some interesting nonempty subarray of $a$, or tell that it doesn't exist.

翻译中…

An array $b$ is a subarray of an array $a$ if $b$ can be obtained from $a$ by deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end. In particular, an array is a subarray of itself.

翻译中…

Input

翻译中…

The first line contains integer number $t$ ($1 \le t \le 10\,000$). Then $t$ test cases follow.

翻译中…

The first line of each test case contains a single integer $n$ ($2\le n \le 2\cdot 10^5$) — the length of the array.

翻译中…

The second line of each test case contains $n$ integers $a_1, a_2, \dots, a_n$ ($0\le a_i \le 10^9$) — the elements of the array.

翻译中…

It is guaranteed that the sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.

翻译中…

Output

翻译中…

For each test case, output "NO" in a separate line if there is no interesting nonempty subarray in $a$.

翻译中…

Otherwise, output "YES" in a separate line. In the next line, output two integers $l$ and $r$ ($1\le l \le r \le n$) — bounds of the chosen subarray. If there are multiple answers, print any.

翻译中…

You can print each letter in any case (upper or lower).

翻译中…

Note

翻译中…

In the second test case of the example, one of the interesting subarrays is $a = [2, 0, 1, 9]$: $\max(a) - \min(a) = 9 - 0 = 9 \ge 4$.

翻译中…

样例

Input #1
3
5
1 2 3 4 5
4
2 0 1 9
2
2019 2020
Output #1
NO
YES
1 4
NO
InputCopy OutputCopy
题目信息
题号
1270B
所属比赛
时间限制
2 s
内存限制
256 MB
标签
构造
贪心
数学

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