Lock and Key Sequence#12236

Lock and Key Sequence

2 seconds
256 megabytes
Medium

You are given an integer and a string of length consisting of lowercase English letters. A lock is defined as a subsequence of exactly k + 2 characters that satisfies:

  1. The first and last characters are the same.

  2. The characters in between are pairwise distinct (all different from each other).

Determine whether such a lock exists in . If it does, print YES and the indices (1 \le i < j \le n) such that is the shortest substring containing a valid lock. If there are multiple valid answers, output any of them. If it does not exist, print NO.

Input

The first line contains an integer (1 \le T \le 1000) — the number of test cases. Each test case consists of:

  • A line containing two integers and (k + 2 \le n \le 2 \cdot 10^5, \ 1 \le k \le 24).

  • A line containing the string of length consisting of lowercase English letters.

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

Output

For each test case:

  • If a lock exists, print YES and the integers and — the indices of the shortest substring containing the lock.

  • If there are multiple valid answers, output any of them.

  • Otherwise, print NO.

Examples

Example 1

Loading
Loading

Note

  • Test Case 1: All elements are unique, so it is impossible to form a valid lock.

  • Test Case 2: The entire string in this case forms a valid lock.

  • Test Case 4: We are given the string kbisabs. The lock may be one of the following: sas or sbs. All of these are valid locks which can be extracted from sabs which is the shortest valid substring

Scoring

  1. Subtask ( points): (1 \le \sum n \le 100).

  2. Subtask ( points): (1 \le \sum n \le 5 \cdot 10^3).

  3. Subtask ( points): contains only two distinct letters.

  4. Subtask ( points): Each letter appears at least k + 2 times.

  5. Subtask ( points): No additional constraints.