Candy Mood
You have a box of chocolate candies that all look the same but have different fillings. Some fillings you find delicious, while others are not to your taste. You randomly select a candy from the box and eat it, which affects your mood based on the filling. If the candy is tasty, your mood change is non-negative; if it's not tasty, the change is negative. Once you eat a candy that isn't tasty, you lose the desire to eat any more candies. If you never encounter a non-tasty candy, you'll eat all the candies in the box.
You know the number of candies with each type of filling in the box and how each filling affects your mood. Your task is to calculate the expected change in your mood after you finish eating candies, whether you stop because you ate a non-tasty candy or because you ate all the candies.
Input
The first line of input contains the integer n - the total number of candies in the box (1 ≤ n ≤ 100). The second line contains n integers a_i, where the i-th number represents the mood change after eating the i-th candy (|a_i| ≤ 100). If a_i is negative, the i-th candy is considered not tasty.
Output
Output a single line with the expected value of the mood change, ensuring an absolute or relative error of no more than 10^{-9}.