CF998A.Balloons

入门

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

There are quite a lot of ways to have fun with inflatable balloons. For example, you can fill them with water and see what happens.

Grigory and Andrew have the same opinion. So, once upon a time, they went to the shop and bought nn packets with inflatable balloons, where ii-th of them has exactly aia_i balloons inside.

They want to divide the balloons among themselves. In addition, there are several conditions to hold:

  • Do not rip the packets (both Grigory and Andrew should get unbroken packets);
  • Distribute all packets (every packet should be given to someone);
  • Give both Grigory and Andrew at least one packet;
  • To provide more fun, the total number of balloons in Grigory's packets should not be equal to the total number of balloons in Andrew's packets.

Help them to divide the balloons or determine that it's impossible under these conditions.

用充气气球来娱乐的方式有很多。例如,你可以往里面灌水,然后看看会发生什么。

格里戈里和安德鲁对此看法一致。于是,有一天他们去商店买了 nn 包充气气球,其中第 ii 包恰好包含 aia_i 个气球。

他们希望将这些气球包分给彼此。此外,还需满足以下条件:

  • 不得拆开气球包(格里戈里和安德鲁都必须获得完整的、未拆封的气球包);
  • 所有气球包都必须被分配(每个气球包都必须分给其中一人);
  • 格里戈里和安德鲁各自至少得到一个气球包;
  • 为了增添乐趣,格里戈里所获气球包中的气球总数不能等于安德鲁所获气球包中的气球总数。

请帮他们完成分配,或判断在上述条件下无法实现分配。

输入格式

The first line of input contains a single integer nn (1≤n≤101 \le n \le 10) — the number of packets with balloons.

The second line contains nn integers: a1a_1, a2a_2, …\ldots, ana_n (1≤ai≤10001 \le a_i \le 1000) — the number of balloons inside the corresponding packet.

输入的第一行包含一个整数 nn(1≤n≤101 \le n \le 10)—— 表示装有气球的包裹数量。

第二行包含 nn 个整数:a1a_1, a2a_2, …\ldots, ana_n(1≤ai≤10001 \le a_i \le 1000)—— 表示对应包裹中气球的数量。

输出格式

If it's impossible to divide the balloons satisfying the conditions above, print −1-1.

Otherwise, print an integer kk — the number of packets to give to Grigory followed by kk distinct integers from 11 to nn — the indices of those. The order of packets doesn't matter.

If there are multiple ways to divide balloons, output any of them.

如果无法按照上述条件分配气球,则输出 −1-1。

否则,先输出一个整数 kk —— 表示分配给 Grigory 的包裹数量,然后输出 kk 个互不相同的、取值范围在 11 到 nn 之间的整数 —— 表示这些包裹的编号。包裹的顺序无关紧要。

如果存在多种分配气球的方式,输出任意一种即可。

输入输出样例

  • 输入#1

    3
    1 2 1

    输出#1

    2
    1 2
  • 输入#2

    2
    5 5

    输出#2

    -1
  • 输入#3

    1
    10

    输出#3

    -1

说明/提示

In the first test Grigory gets 33 balloons in total while Andrey gets 11.

In the second test there's only one way to divide the packets which leads to equal numbers of balloons.

In the third test one of the boys won't get a packet at all.

在第一次测试中,格里戈里总共获得 33 个气球,而安德烈获得 11 个。

在第二次测试中,只有一种分配小包的方式能使两人获得的气球数量相等。

在第三次测试中,其中一个男孩将完全无法获得任何小包。

输入解题思路,AI测评打分。不知道怎么写?

首页