Competitions

# 2022 Azerbaijan Round 1, 8-9-10-11 classes

# Divisible interval

You are given an array **a** of integers `a`

, _{1}`a`

, ..., _{2}`a`

. Find any subarray of this array which sum of elements is exactly divisible by _{n}**n**. That is, find numbers (**i**, **j**) (**1** ≤ **i** ≤ **j** ≤ **n**) such that the sum (`a`

+ _{i}`a`

+ ... + _{i+1}`a`

) is exactly divisible by _{j}**n**. If such a pair (**i**, **j**) cannot be found, then output the pair (**−1**, **−1**) as an answer.

#### Input

The first line contains the number **n** (**1** ≤ **n** ≤ `10`

) of elements of array ^{5}**a**. The next line contains **n** integers `a`

, _{1}`a`

, ..., _{2}`a`

(_{n}**0** ≤ `a`

≤ _{i}`10`

).^{9}

#### Output

Print any pair (**i**, **j**) (**1** ≤ **i** ≤ **j** ≤ **n**) satisfying the condition in one line, or (**−1**, **−1**) if there is no such pair.

#### Explanation

`a`

+ _{1}`a`

+ _{2}`a`

= _{3}**4** + **2** + **4** = **10**. The sum is divisible by **5**.

Input example #1

5 4 2 4 3 6

Output example #1

1 3