## COCI '19 Contest 4 #5 Nivelle

View as PDF

Points: 12 (partial)
Time limit: 1.0s
Memory limit: 512M

Problem types
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

Original task description has been altered due to excessive violence. The following program is suitable for minors.

Bojan sees cute little fluffy edible toys (yaay!) on a store shelf, ordered from to . Each fluffy toy is colored in one of different colors. Each color is denoted by a lowercase letter from the English alphabet. Bojan wants to eat some of these toys (drool).

For any set of toys, we can define its colorfulness as the number of different colors of toys in a set, divided by the total number of toys in a set. Bojan hates colorfulness. Bojan is very hungry. Bojan wants to eat a contiguous subsequence of toys.

Help Bojan find a contiguous subsequence of toys whose colorfulness is as small as possible.

#### Input

The first line contains an integer , the length of array of toys from task description.

The second line contains a string of length . The -th character of the string represents the color of -th toy from the shelf.

#### Output

Output two indices and , which denote that the sought contiguous subsequence of toys is located at positions .

If there exists more than one contiguous subsequence with the same minimal colorfulness, you can output and which define any of them.

#### Scoring

contains only letters a and b
contains only letters a, b, c, d and e

#### Sample Input 1

4
honi

#### Sample Output 1

1 4

#### Sample Input 2

7
nivelle

#### Sample Output 2

4 7

#### Sample Input 3

6
ananas

#### Sample Output 3

1 5