欢迎来到起遇信息学
起遇信息学正处于上线筹建阶段,以下功能已全部开放免费体验: ✅ 完整题库浏览与代码提交评测(C / C++ / Python / Java 等) ✅ 入门到进阶的系列课程试读、作业与考试 ✅ AI 提示、AI 作业分析等智能助教功能 ✅ 赛事模拟与个人能力报告 ✅ 邮箱注册开放 ⏳ 付费课程订阅与微信/支付宝支付通道 ⏳ 手机号登录,微信扫码登录、微信公众号绑定 使用中如遇任何问题,欢迎通过页面底部 **"联系我们"** 与我们沟通。
CF998A.Balloons
Balloons
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 packets with inflatable balloons, where -th of them has exactly 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.
Input
The first line of input contains a single integer () — the number of packets with balloons.
The second line contains integers: , , , () — the number of balloons inside the corresponding packet.
Output
If it's impossible to divide the balloons satisfying the conditions above, print .
Otherwise, print an integer — the number of packets to give to Grigory followed by distinct integers from to — the indices of those. The order of packets doesn't matter.
If there are multiple ways to divide balloons, output any of them.
Note
In the first test Grigory gets balloons in total while Andrey gets .
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.
Samples
3
1 2 1
2
1 2
2
5 5
-1
1
10
-1
在线编程 IDE
建议全屏模式获得最佳体验
| 进入全屏编程 | Alt+E |
| 递交评测 | Ctrl+Enter |
| 注释/取消注释 | Ctrl+/ |
| 缩放字体 | Ctrl+滚轮 |