Codeforces Beta Round 31(Div. 2,Codeforces 格式)
A
蠕虫进化
Worms Evolution
Codeforces
1200
原题
←B →

蠕虫进化AI (CI翻译)

Professor Vasechkin is studying evolution of worms. Recently he put forward hypotheses that all worms evolve by division. There are $*n*$ forms of worms. Worms of these forms have lengths $*a*_{1}$, $*a*_{2}$, ..., $*a*_{*n*}$. To prove his theory, professor needs to find 3 different forms that the length of the first form is equal to sum of lengths of the other two forms. Help him to do this.

瓦谢奇金教授正在研究蠕虫的进化。最近,他提出了一个假设:所有蠕虫都是通过分裂进化的。蠕虫共有 $*n*$ 种,长度分别为 $*a*_{1}$、$*a*_{2}$、...、$*a*_{*n*}$。为了证明他的理论,教授需要找到 3 种不同的蠕虫,其中第一种的长度等于另外两种长度之和。请帮助他完成这项工作。AI (CI翻译)

Input

输入格式

AI (CI翻译)

The first line contains integer $*n*$ ($3 ≤ *n* ≤ 100$) — amount of worm's forms. The second line contains $*n*$ space-separated integers $*a*_{*i*}$ ($1 ≤ *a*_{*i*} ≤ 1000$) — lengths of worms of each form.

第一行包含一个整数 $*n*$($3 ≤ *n* ≤ 100$),表示蠕虫的种类数。第二行包含 $*n*$ 个以空格分隔的整数 $*a*_{*i*}$($1 ≤ *a*_{*i*} ≤ 1000$),表示每种蠕虫的长度。AI (CI翻译)

Output

输出格式

AI (CI翻译)

Output 3 distinct integers $*i*$ $*j*$ $*k*$ ($1 ≤ *i*, *j*, *k* ≤ *n*$) — such indexes of worm's forms that $*a*_{*i*} = *a*_{*j*} + *a*_{*k*}$. If there is no such triple, output -1. If there are several solutions, output any of them. It possible that $*a*_{*j*} = *a*_{*k*}$.

输出 3 个互不相同的整数 $*i*$ $*j*$ $*k*$($1 ≤ *i*, *j*, *k* ≤ *n*$),表示满足 $*a*_{*i* = *a*_{*j* + *a*_{*k*}$ 的三种蠕虫的下标。如果不存在这样的三元组,输出 -1。如果有多个解,输出任意一个。$*a*_{*j*}$ 可以等于 $*a*_{*k*}$。AI (CI翻译)

样例

Input #1
5
1 2 3 5 7
Output #1
3 2 1
InputCopy OutputCopy
Input #2
5
1 8 1 5 1
Output #2
-1
InputCopy OutputCopy
题目信息
题号
31A
时间限制
2 s
内存限制
256 MB
标签
模拟

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