eolymp
bolt
Try our new interface for solving problems
Məsələlər

Epic Fail of a Genie

Epic Fail of a Genie

Aladdin had found a new shiny lamp and has started polishing it with his hands. Suddenly a mysterious genie appeared from within and offered Aladdin to fulfill any of his three wishes. Genie had a very subtle humor that made Aladdin very sceptical about him. Aladdin didn’t believe that genie was so powerful that could do anything he had wished and asked him to become a mouse. The genie did that without hesitation. Then Aladdin asked genie to become a mouse pad. Genie didn’t like this kind of wish but had to submit. Finally Aladdin tested genie’s abilities in math: he had to choose a nonempty subset giving the maximum product from the given set of numbers. Genie was shocked. Math was his Achilles’ heel, however he was able to contact anyone on earth to help him. You are a secret weapon of the genie --- help him solve the test and avoid this epic fail. This is the last chance for the genie: he’ll be forever jailed in the lamp if his new master doesn’t trust him. \InputFile The first line of input contains an integer \textbf{N} (\textbf{2} ≤ \textbf{N} ≤ \textbf{10^4}) --- the cardinality of a set of numbers. The second line of input contains \textbf{N} floating-point numbers with absolute value not more than \textbf{10^6}. The fractional part of each number does not contain more than two digits. \OutputFile The first line of the output should contain a single integer \textbf{M} --- the total number of numbers that genie should choose from the set. The second line of output should contain \textbf{1}-based indexes of these numbers. Indexes must be sorted in ascending order. If multiple solutions exist please output the one with the minimal subset cardinality. If there are still several suitable solutions output any of them.
Zaman məhdudiyyəti 1 saniyə
Yaddaşı istafadə məhdudiyyəti 256 MiB
Giriş verilənləri #1
7
1 3 0 -1 -2 0.5 3
Çıxış verilənləri #1
4
2 4 5 7
Mənbə ACM ICPC 2012-2013, NEERC, Moscow Subregion, Moscow, Sunday, October 21, 2012