{"raw_statement":[{"iden":"statement","content":"Ohm Sweet Ohm\n\nYou have a circuit consisting of many resistors in parallel, and you want to calculate their equivalent resistance, in ohms. \n\nIf you competed in our Contest #2 back in January, you might remember that the formula for calculating the equivalent resistance of two resistors in parallel with resistances $a$ and $b$ is $(a * b) \\/ (a + b)$. \n\nTo calculate the equivalent resistance of three parallel resistors, first calculate the equivalent resistance of the first two using the formula described above. Then, use the formula again to calculate the equivalent resistance of the third resistor and the value you just calculated, the equivalent resistance of the first two resistors. Calculating the equivalent resistance of more than three resistors works in a similar way. \n\nFormally, the equivalent resistance of $n$ resistors can be calculated by plugging in the equivalent resistance of the first $n -1$ resistors, and the resistance of the $n$th resistor, into the above formula.\n\nThe first line of input contains a positive integer $n$ greater than one, indicating the number of resistors in the circuit. Assume that all of the resistors are in parallel with each other. The next line contains $n$ space-separated positive integers, each representing the resistance of a resistor in the circuit.\n\nOutput a single positive decimal number: the equivalent resistance of the circuit. You don't need to (and you shouldn't) round your answer.\n\n"},{"iden":"input","content":"The first line of input contains a positive integer $n$ greater than one, indicating the number of resistors in the circuit. Assume that all of the resistors are in parallel with each other. The next line contains $n$ space-separated positive integers, each representing the resistance of a resistor in the circuit."},{"iden":"output","content":"Output a single positive decimal number: the equivalent resistance of the circuit. You don't need to (and you shouldn't) round your answer."},{"iden":"examples","content":"Input9\n37 23 56 85 41 99 33 22 11\nOutput3.319115819885067\nInput2\n11 19\nOutput6.966666666666667\n"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $, $ n > 1 $, be the number of resistors.  \nLet $ R = (r_1, r_2, \\dots, r_n) $ be a sequence of positive real numbers representing the resistances.\n\n**Objective**  \nCompute the equivalent resistance $ R_{\\text{eq}} $ of $ n $ resistors in parallel, defined recursively by:  \n$$\nR_{\\text{eq}} = \\left( \\sum_{i=1}^n \\frac{1}{r_i} \\right)^{-1}\n$$","simple_statement":"Given n resistors in parallel, calculate their total equivalent resistance using the formula: for two resistors a and b, equivalent resistance is (a * b) / (a + b). Apply this formula iteratively for all resistors. Output the result as a decimal number.","has_page_source":false}