408461: GYM103134 F Confusing Morete

Memory Limit:256 MB Time Limit:3 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

F. Confusing Moretetime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Morete is a student of Molecular Sciences who has dedicated himself a lot to the Maratona, participating in many Codeforces contests. These contests are tests with an approximate duration of 2 hours in which the participant has to solve a certain amount of problems, winning or losing rating (score on the platform) depending on his performance.

At the end of each contest, Morete writes on a card how much he gained or lost in rating, and then he places this card on top of a pile, forming a stack with his cards. Morete does this to control his performance.

Thiago, his archenemy, jealous of Morete's dedication, decides to hinder him and for that, inserts a single card with any number, somewhere in the stack of rating cards. At the end of the month, when Morete decides to analyze his performance, he notes that, at some point, he had a negative rating balance, which left him confused, because from what he remembers, he always had a non-negative rating balance.

Your task is to help Morete to find out which cards are suspected to have been inserted in the pile by Thiago, or to say if Morete got stoned and made a mistake.

For example, let $$$ [500, -100, -400, 100, -500, 200] $$$ be the numbers written on the cards in the stack with Morete's ratings after Thiago has inserted his card, where the number at the beginning of the list is in the bottom of the stack, and the one at the bottom on top. So, the suspect cards would be the ones with values ​​$$$-400$$$ and $$$-500$$$ (indices $$$3$$$ and $$$5$$$, respectively), since either of them, if ignored, makes Morete always have a non-negative rating.

Input

The first line contains an integer $$$N$$$ $$$(2 \leq N \leq 10^5)$$$ ─ the number of cards in the stack, after Thiago has inserted his.

The second line contains $$$ N $$$ integers ─ where $$$ r_i $$$ $$$ (-10^9 \leq r_i \leq 10^9)$$$ is the value of the $$$ i $$$-th card in the stack.

Output

If at any time Morete has a negative balance, print "morete chapou: errou conta" (without quotes).

If there is not at least one card, which if ignored, Morete will always have a non-negative balance, print "morete chapou: ficou com saldo negativo" (without quotes).

Otherwise, on the first line, print $$$ k $$$ ─ the number of suspicious cards. On the second line, print $$$ k $$$ integers ─ the positions of these cards in the stack, indexed from 1 and in any order.

ExamplesInput
6
500 -100 -400 100 -500 200
Output
2
3 5 
Input
4
200 -180 20 80
Output
morete chapou: errou conta!
Input
7
1100 -700 60 -700 200 -700 2000
Output
morete chapou: ficou com saldo negativo!

加入题单

算法标签: