Problem:


Score : 200 points

Problem Statement

Given is a sequence of N integers A_1, \ldots, A_N.

Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Constraints

1 \leq N \leq 100

1 \leq A_i \leq 1000

Input

Input is given from Standard Input in the following format:

N
A_1 A_2 \ldots A_N

Output

Print a decimal number (or an integer) representing the value of \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Your output will be judged correct when its absolute or relative error from the judge's output is at most 10^{-5}.

Sample Input 1

2
10 30

Sample Output 1

7.5

\frac{1}{\frac{1}{10} + \frac{1}{30}} = \frac{1}{\frac{4}{30}} = \frac{30}{4} = 7.5.

Printing 7.50001, 7.49999, and so on will also be accepted.

Sample Input 2

3
200 200 200

Sample Output 2

66.66666666666667

\frac{1}{\frac{1}{200} + \frac{1}{200} + \frac{1}{200}} = \frac{1}{\frac{3}{200}} = \frac{200}{3} = 66.6666....

Printing 6.66666e+1 and so on will also be accepted.

Sample Input 3

1
1000

Sample Output 3

1000

\frac{1}{\frac{1}{1000}} = 1000.

Printing +1000.0 and so on will also be accepted.



Sample input:
2
10 30


Sample output:
7.5

Submission status: Wrong Answer

Solution code:
n = int(input())
*p, = map(int,input().split())
print(p)
a = 0
for i in range(n):
  a += 1/p[i]
  print(a)
print(1/a)

Submission status: Wrong Answer

Solution code:
a = int(input())
s = list(map(int,input().split()))

ans = 0

for i in s:
    print (ans)
    print (1/i)
    ans += (1/i)
    

print (1/ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
lst = list(map(int, input().split()))
ans = []
for j in lst:
    ans.append(1 / j)
print(sum(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())
print(sum([1/float(a) for a in input().split()]))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = map(int, input().split())

# r = 0
# for a in A:
#     r += 1 / a
# print(1 / r)

print(sum(1 / a for a in A))

Submission status: Wrong Answer

Solution code:
import numpy
n=int(input())
a=list(map(int,input().split()))
suma=numpy.sum(a)
sekia=numpy.prod(a)
print(sekia/suma)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input().split(' ')
for i in range(n):
  a[i] = int(a[i])

def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a

bunshi = 1
bunbo = a[0]
for i in range(1, n):
  bunshi = bunbo + a[i]
  bunbo = bunbo * a[i]
  gcdtmp = gcd(bunbo, bunshi)
  bunbo = bunbo / gcdtmp
  bunshi = bunshi / gcdtmp
print(bunbo / bunshi)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
r=0
for i in a:
  r+=1/i
print(r)

Submission status: Wrong Answer

Solution code:
n =int(input())
a = list(map(int,input().split()))
for i in range(len(a)):
  a[i]=1/a[i]
  
print(sum(a))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))

s = [1 / a for a in A]
ans = sum(s)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
sam = 0
for i in range(N):
  sam += A[i]**-2
print(sam**-2)

Submission status: Wrong Answer

Solution code:
a = int(input())
s = input()
if a >= 3200:
    print(s)
else:
    print('red')

Submission status: Wrong Answer

Solution code:
import numpy as np

n = int(input())
s = np.array(list(map(int, input().split())))
if len(s) == 1:
  print(s)
else:
  print(
     np.prod(s) / (sum(s) * (len(s) -1))
  )

Submission status: Wrong Answer

Solution code:
N = input()
A = input().split()

numerator = 1
denominator = 0
for value in A:
    numerator *= int(value)    
    denominator += int(value)

print(float(numerator / denominator))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = sorted(list(map(float, input().split())),reverse=True)
b = [1]
for i in range(1, n):
    c = float(a[0]) // a[i]
    b.append(c)
print('{:.5f}'.format(float(a[0]) / sum(b)))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(v) for v in input().split(' ')]

sum1 =0
sum2=1
for v in a:
  sum1+=v
  sum2*=v

print("%.5f" % (sum2/sum1))

Submission status: Wrong Answer

Solution code:
n=int(input())
a = list(map(int, input().split()))
new_a=[i**(-1) for i in a]
print(new_a)
aa=sum(new_a)
print(aa**(-1))

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int, input(). strip(). split()))
for i in range(n):
    A[i]=1/A[i]
print(round(sum(A),5))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(float, input().split()))
c = 1
for i in range(n):
    c = c * a[i]
print(float(c) / sum(a))

Submission status: Wrong Answer

Solution code:
N = int(input())
S = 0
A = list(map(int,input().split()))
for i in A:
  S += 1/A[0]
print(1/S)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
from fractions import Fraction

# 整数の入力
N = int(raw_input())

li = map(int, raw_input().split())

res = 0

for i in xrange(0,N):
	res += Fraction(1,li[i])


print 1/res

Submission status: Wrong Answer

Solution code:
n = int(input())
a = sorted(list(map(float, input().split())),reverse=True)
b = [1]
for i in range(1, n):
    c = a[0] // a[i]
    b.append(c)
print(float(a[0]) / sum(b))

Submission status: Wrong Answer

Solution code:
import fractions

def get_lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

def get_num(a, lcm):
    return lcm // a


N_str = input()
a_str = input()
a_str_list = a_str.split(" ")
a_list = list(map(lambda x: int(x), a_str_list))
lcm = 1
for a in a_list:
    lcm = get_lcm(lcm, a)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = sorted(list(map(int, input().split())),reverse=True)
b = [1]
for i in range(1, n):
    c = a[0] // a[i]
    b.append(c)
print(float(a[0]) / float(sum(b)))

Submission status: Wrong Answer

Solution code:
import math

def get_lcm(x, y):
    return x
    return (x * y) // math.gcd(x, y)

def get_num(a, lcm):
    return lcm // a


N_str = input()
a_str = input()
a_str_list = a_str.split(" ")
a_list = list(map(lambda x: int(x), a_str_list))
lcm = 1
for a in a_list:
    lcm = get_lcm(lcm, a)

Submission status: Wrong Answer

Solution code:
import math

def get_lcm(x, y):
    return (x * y) // math.gcd(x, y)

def get_num(a, lcm):
    return lcm // a


N_str = input()
a_str = input()
a_str_list = a_str.split(" ")

Submission status: Wrong Answer

Solution code:
N = int(input().rstrip())
A = input().rstrip().split(" ")
a = 1
b = 0
for i in range(N):
  a *= int(A[i])
  b += int(A[i])
c = b / a
print('{:.6f}'.format(c))

Submission status: Wrong Answer

Solution code:
N = int(input().rstrip())
A = input().rstrip().split(" ")
a = 1
b = 0
for i in range(N):
  a *= int(A[i])
  b += int(A[i])
c = a / b
print('{:.6f}'.format(c))

Submission status: Wrong Answer

Solution code:
import math

Submission status: Wrong Answer

Solution code:
N = int(input())
 
A = map(int,input().split())

def inverse(A):
  A = sum(A)
  def inverse(A):
    print(sum(A))

Submission status: Wrong Answer

Solution code:
N = int(input().rstrip())
A = input().rstrip().split(" ")
a = 1
b = 0
for i in range(N):
  a *= int(A[i])
  b += int(A[i])
c = a / b
print(c)

Submission status: Wrong Answer

Solution code:
from fractions import Fraction
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
  a[i] = Fraction(1, a[i])

print(Fraction(1,sum(a)))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
print(1/sum(a))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
import sys
import math
from datetime import datetime

def sol(n, S):
    ret = 0
    for s in S:
        print(s)
        ret += (1.0 / s)
        print (ret)
    return (1.0/ret)



do_submit = True
#do_submit = False

def input_parse(input_str):
    lines = [x.strip() for x in input_str.split("\n") if x.strip()]
    parsed_lines = [list(map(str, line.split())) for line in lines]
    print(parsed_lines)
    n = int(parsed_lines[0][0])
    S = list(map(int, parsed_lines[1]))
    # S = parsed_lines[1][0]
    # return n, k, S
    return n, S


if not do_submit:
    n, S = input_parse("""
    2
    10 30
    """)
    print(sol(n, S))

else:
    n = int(input().strip())
    S = list(map(int, input().split()))
    #S = input().split()
    # print(sol(n, k, S))

    #s = input().strip()
    # S = input().strip()
    print(sol(n, S))

Submission status: Wrong Answer

Solution code:
n=int(input())
x=0
y=1
a=list(map(int,input().split()))
if n==1:
    print(a[0])
else:
    for i in range(0,n):
        x=a[i]+x
        y=a[i]*y
        ans=y/x
    if x==a[0]*n:
        if a[0]!=1:
            print(round(a[0]/n,5))
        else:
            print(n)
    else:
        print(round(ans,5))

Submission status: Wrong Answer

Solution code:
a = int(input())
n = list(map(int, input().split()))
b = []
for i in range(len(n)):
    b.append(1/n[i])
ans = sum(b)
print(round(ans,5))

Submission status: Wrong Answer

Solution code:
a = int(input())
n = list(map(int, input().split()))
b = []
for i in range(len(n)):
    b.append(1/n[i])
ans = sum(b)
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
x=0
y=1
a=list(map(int,input().split()))
if n==1:
    print(a[0])
else:
    for i in range(0,n):
        x=a[i]+x
        y=a[i]*y
        ans=y/x
    if x==a[0]*n:
        print(round(a[0]/n,5))
    else:
        print(round(ans,5))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(v) for v in input().split(' ')]

sum1 =0
sum2=1
for v in a:
  sum1+=v
  sum2*=v

print("%f",sum2/sum1)

Submission status: Wrong Answer

Solution code:
n=int(input())
x=0
y=1
a=list(map(int,input().split()))
if n==1:
    print(a[0])
else:
    for i in range(0,n):
        x=a[i]+x
        y=a[i]*y
        ans=y/x
        if x==a[0]*n:
            print(round(a[0]/n,5))
        else:
            print(round(ans,5))

Submission status: Wrong Answer

Solution code:
n = int(raw_input())
a = map(int, raw_input().split())
b = 0.0
print(a)
for i in range(n):
    b = b + 1/float(a[i])
print(1/b)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    data = list(map(int, input().split()))

    for k in data:
        if k == 0:
            return 0

    # up = 0
    # for i in range(n):
    #     up *= data[i]

    # down = 0
    # for j in range(n):
    #     down += up / data[j]

    # return up / down

print(main())

Submission status: Wrong Answer

Solution code:
N =int(input())
A = list(map(int,input().split(" ")))
lst = []

S = max(A)
for a in A:
    for i in range(0,1000):
        if a*i == S:
            lst.append((i,a*i,))
            break

C = sum([i[0] for i in lst])
R = lst[0][1]/C
if R.is_integer():
    print(int(R))
else:
    print(R)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
bunbo=0
mx=max(a)
mn=min(a)
for i in range(n):
    bunbo+=a[i]/mn
print(mx/bunbo)

Submission status: Wrong Answer

Solution code:
n=int(input())
x=0
y=1
a=list(map(int,input().split()))
if n==1:
    print(a[0])
else:
    for i in range(0,n):
        x=a[i]+x
        y=a[i]*y
        ans=y/x
        if x==a[0]*n:
            print(a[0]/n)
        else:
            print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
list = [int(i) for i in input().split()]
gyaku = 0

for j in list:
  gyaku += round(1/j,5)

print(round(1/gyaku, 5))

Submission status: Wrong Answer

Solution code:
from fractions import Fraction
_=input()
L=input().split()
ans=0

def inverse(f):
    return Fraction(f.denominator,f.numerator)

for i in L:
	print(i)
	ans+=Fraction(1, int(i))
print(float(inverse(ans)))

Submission status: Wrong Answer

Solution code:
from functools import reduce
import operator

n =int(input())
a = [int(x) for x in input().split()]
sum([1/x for x in a])

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []
a = list(map(int, input().strip().split()))

print(a)

all_sum = 0

for i in range(n):
  all_sum += 1/a[i]

ans = 1 / all_sum

print(ans)

Submission status: Wrong Answer

Solution code:
N =int(input())
A = list(map(int,input().split(" ")))
lst = []

S = max(A)
for a in A:
    for i in range(0,1000):
        if a*i == S:
            lst.append((i,a*i,))
            break

C = sum([i[0] for i in lst])
print(lst[0][1]/C)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    data = list(map(int, input().split()))

    for k in data:
        if k == 0:
            return 0

    up = 0
    for i in range(n):
        up *= data[i]

    down = 0
    for j in range(n):
        down += up / data[j]

    print(up / down)

Submission status: Wrong Answer

Solution code:
import numpy as np

n = int(input())

a = list(map(int, input().split()))
p = np.prod(a)

top = p
under = 0

for aa in a:
    under += p / aa

print(top / under)

Submission status: Wrong Answer

Solution code:
from operator import add
from functools import reduce

n = int(input())
int_list = list(map(int,input().split()))
print(int_list)

def back(x):
    return 1 / x
print(back(10))

l = list(map(back, int_list))
print(1/(reduce(add, l)))

Submission status: Wrong Answer

Solution code:
n = int(input())
num_list = map(int, input().split())
def ave(nums):
    rev_sum = 0
    for i in nums:
        rev_sum += 1/i
    ans = 1/rev_sum
    return ans

ave(num_list)

Submission status: Wrong Answer

Solution code:
import operator
def prod(array):
        result = 1
        for i in range(len(array)):
                result *= array[i]
        return result
n = int(input())
a = list(map(int,input().split()))
print(1/(sum(a)/prod(a)))

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(map(int,input().split()))
s=0
for i in l:
  s+=1/(1/i)
print(s)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [int(x) for x in input().split()]
m = l[0]
for i in range(1,len(l)):
  m*=l[i]
print(m/sum(l))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
a_max = max(A)
c = []
for x in range(N):
  if A[x] < a_max:
    c.append(int(a_max / A[x]))
  else:
    c.append(1)
print(a_max / int(sum(c)))

Submission status: Wrong Answer

Solution code:
import fractions
n = int(input())
a = list(map(int,input().split()))
a.sort()
if n==1:
    print(a)
else:
    s = a[0]
    for i in range(1,n):
        s = s * a[i] // fractions.gcd(s, a[i])
    ans = 0
    for i in a:
        ans += s//i
    print(s/ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
arr = list(map(int, input().split()))
print(arr[0])
total = 0
for a in arr:
    total += 1/a
print(1/total)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = input().split()

sum = 0
for a in A:
  print(1/float(a))
  sum = sum + (1/float(a))

print(1/sum)

Submission status: Wrong Answer

Solution code:
N = int(input()) # 数字を変数に格納
List = list(map(int,input().split())) # 複数の数字をリストに格納

total = 1
sum = 0

for i in range(N):
    total = total * List[i]

l = []
for i in range(N):
    l.append(total / List[i])
    
for i in range(N):
    sum = sum + List[i]
    
result = total / sum

print(result)

Submission status: Wrong Answer

Solution code:
import fractions
n = int(input())
a = list(map(int,input().split()))
a.sort()
if n==1:
    print(a)
else:
    s = a[0]
    for i in range(1,n):
        s = s * a[i] // fractions.gcd(s, a[i])
    ans = 0
    for i in a:
        print(s//i)
        ans += s//i
    print(s/ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
import numpy as np
l = np.prod(a)
ans = 0
for i in range(n):
    ans += l / a[i]
print(l/ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = input().split()

print(A)
sum = 0
for a in A:
  print(1/float(a))
  sum = sum + (1/float(a))

print(1/sum)

Submission status: Wrong Answer

Solution code:
a=int(input())
li = list(map(float,input().split()))
for i in li:
  i = 1/i
s=sum(li)
print(1/s)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int,input().split()))
xx = 0
for x in l:
	#print(10/x)
	xx += 10/x
print(1/xx)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))

alla = sum(A)
k = 1
for i in A:
    k = k*i

print(k/alla)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
A = list(map(int, input().split()))
A = np.array(A)
print(np.prod(A)/np.sum(A))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split(" ")))
mul = 1
sum = 0
for i in range(N):
    sum += A[i]
    mul *= A[i]

print(1/(sum/mul))

Submission status: Wrong Answer

Solution code:
n=int(input())
A=map(int,input().split())
a=list(A)
k=0

for i in range(0,n):
    k=k+(1/(a[i]))

print(k)

Submission status: Wrong Answer

Solution code:
N = int(input())
li = list(map(int,input().split()))
li2 = []
for i in li:
    li2.append(1/i)
print(sum(li2))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=map(int,input().split())
b=0
for i in a:
  b+=(1/i)
print(b)

Submission status: Time Limit Exceeded

Solution code:
input()
(*a,) = map(int, input().split())
ma = max(a)

最小公倍数 = ma
while not all(最小公倍数 % i == 0 for i in set(a)):
    最小公倍数 += ma
ans = 最小公倍数 / sum(最小公倍数 // i for i in a)
print([ans, int(ans)][ans % 1 == 0])

Submission status: Time Limit Exceeded

Solution code:
input()
(*a,) = map(int, input().split())
ma = max(a)

最小公倍数 = ma
while True:
    if all(最小公倍数 % i == 0 for i in a):
        break
    最小公倍数 += ma
ans = 最小公倍数 / sum(最小公倍数 // i for i in a)
print([ans, int(ans)][ans % 1 == 0])

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))
a.sort()
z = a[0]
t = 1

while t != 0:
    t = 0
    for i in range(1,n):
        if z % a[i] != 0:
            t = 1
    if t == 1:
        z += a[0]

y = 0
for i in range(n):
    y += z // a[i]

print(z / y)

Submission status: Time Limit Exceeded

Solution code:
while True:
    try:
        N = int(input())
        if N>0 or N<=100:
            A = []
            for i in range(0,N):
              B = int(input())
              if B>0 or B<=100:
                  A.append(B)

            sum1 = 1/A[0]

            for i in range(0,N-1):
              sum1 = sum1 + 1/A[i+1]

            result = 1/sum1
            print(result)

            break

    except:
            print("Error")

Submission status: Time Limit Exceeded

Solution code:
while True:
    try:
        N = int(input())
        if N>0 or N<=100:
            A = []
            for i in range(0,N):
              B = int(input())
              if B>0 or B<=100:
                  A.append(B)

            sum1 = float(1/A[0])

            for i in range(0,N-1):
              sum1 = sum1 + 1/A[i+1]

            result = 1/sum1
            print(result)

            break

    except:
            print("Error")

Submission status: Time Limit Exceeded

Solution code:
while True:
    try:
        N = int(input())
        A = []
        for i in range(0,N):
          B = int(input())
          A.append(B)

        sum1 = float(1/A[0])

        for i in range(0,N-1):
          sum1 = sum1 + 1/A[i+1]

        result = 1/sum1
        print(result)

        break

    except:
        print("Error")

Submission status: Time Limit Exceeded

Solution code:
# Given is a sequence of N integers A1,[ldots],AN.

# Find the (multiplicative) inverse of the sum of the inverses of these numbers,  1	 1	A1 +[ldots]+ 1	AN  .

def gcd(a, b):
    while b > 0:
        if a >= b:
            a -= b
        else:
            a, b = b, a
    return a

def lcm(a, b):
    return a*b//gcd(a, b)

input() # N; >0
resistances = [int(a) for a in input().split()]
lcm_r = 1
for r in resistances:
    lcm_r = lcm(r, lcm_r)
# numerator is lcm of resistances
# denominator is sum of lcm/resistance for resistance in resistances
num = lcm_r
denominator = 0
for r in resistances:
    denominator += lcm_r//r
print(num/denominator)

Submission status: Time Limit Exceeded

Solution code:
N =int(input())
A = list(map(int,input().split(" ")))
lst = []

S = max(A)
for a in A:
    for i in range(0,100000000):
        if a*i == S:
            lst.append((i,a*i,))
            break

C = sum([i[0] for i in lst])
R = lst[0][1]/C
if R.is_integer():
    print(int(R))
else:
    print(R)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(n):
  ans += 1/a[i]
print(1/ans)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in a:
    ans += (1/i)
print(1/ans)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))

ans = 0

for i in range(n):
  ans += 1/a[i]
  
print(1/ans)

Submission status: Accepted

Solution code:
N = int(input())
Alst = list(map(int, input().split()))
ans = 0
for i in Alst:
    ans += 1/i

print(1/ans)

Submission status: Accepted

Solution code:
s = int(input())
a = [(1/int(i)) for i in input().split()]
print(1/sum(a))

Submission status: Accepted

Solution code:
def resolve():
    n = int(input())
    a = [1/(int(i)) for i in input().split()]
    print(1/sum(a))
resolve()

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))
s = 0

for i in range(n):
    s += 1/A[i]
print(1/s)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = 0
for a in A:
    if a == 0:
        continue
    ans += 1 / a
if ans == 0:
    print(0)
else:
    print(1 / ans)

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))

ans = 0

for a in A:
    ans += 1/a

print(1/ans)

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
ans = 0
for i in range(N):
    ans += 1/A[i]
print(1/ans)

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))

X=0
for a in A:
    X+=1/a
print(1/X)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int ,input().split()))
sum=0
for i in range(0,n):
    ans=1/a[i]
    sum+=ans

print(float(1/sum))

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))


B = 0

for i in range(N):
    B = B + (1 / A[i])

print(1 / B)

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
print(1/sum([1/a for a in A]))

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))

rev = 0
for i in range(N):
  rev += 1 / A[i]
print(1 / rev)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
ans=0.0
for i in range(n):
  ans=ans+1.0/a[i]
ans=1.0/ans
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))

ans = 0
for i in a:
    ans += 1 / i

ans = 1 / ans

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = 0
for a in A:
    ans += 1 / a

ans = 1 / ans
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
print(1/sum(1/a for a in A))

Submission status: Accepted

Solution code:
# import math
# import statistics
# import itertools
a=int(input())
#b,c=int(input()),int(input())
# c=[]
# for i in a:
#     c.append(int(i))
# e1,e2,e3,e4 = map(int,input().split())
f = list(map(int,input().split()))
# g = [int(input()) for _ in range(a)]
bunbo=0
for i in range(len(f)):
    bunbo+=1/f[i]
print(1/bunbo)

Submission status: Accepted

Solution code:
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 6)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()

N = k()
A = l()
for i in A:
    ans += 1/i
 
ans = 1/ans
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))

tmp = 0
for i in A:
    tmp += 1 / i
print(1/tmp)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split(' ')))

ans = 0
for i in a:
    ans += 1 / i
print(1 / ans)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(lambda x:1/int(x),input().split()))
print(1/sum(a))

Submission status: Accepted

Solution code:
n = int(input())
print(1/sum([1/int(n) for n in input().split()]))

Submission status: Accepted

Solution code:
N = float(input())
A = [1/f for f in map(float, input().split())]
print(1/sum(A))

Submission status: Accepted

Solution code:
n = int(input())
lst = list(map(int,input().split()))
tmp = 0
for i in range(n):
  tmp = tmp + 1/lst[i]
print(1/tmp)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
b = []

for x in a :
  b.append(1/x)
  
c = sum(b)
ans = 1/c
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
 
s = 0
for i in range(N):
  s += 1 / A[i]

print(1/s)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in a:
  ans += 1 / i

ans = 1 / ans
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
check = 0
from decimal import Decimal
for i in range(N):
  check += Decimal(1/A[i])
ans = Decimal(1/check)
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
A_lis=list(map(int,input().split()))
a=0        
for i in A_lis:
   a += 1/i
ans = 1/a
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
d = 0
for i in range(n):
  d += 1 / a[i]
ans = 1 / d
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
deno = sum(map(lambda x: 1 / x, A))
print(1/deno)

Submission status: Accepted

Solution code:
n = int(input())

s = list(map(int, input().split()))
t = []
v = 0

for i in range(n):
  c = 1/s[i]
  t.append(c)
  
for j in range(n):
  v += t[j]
  
ans = 1/v

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))

print(1/sum(list(map(lambda x: 1/x, a))))

Submission status: Accepted

Solution code:
n=int(input())
a=[int(x) for x in input().split()]

deno=0
for i in a:
    deno+=1/i
print(1/deno)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
s=0

for i in range(n):
  s+=1/a[i]
print(1/s)

Submission status: Accepted

Solution code:
n = int(input())
list_a = [int(i) for i in input().split()]
ans = 0.0
for i in range(0, n):
    ans += 1 / list_a[i]
    if i == n - 1: ans = 1 / ans
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
nu = 1
de = 0
for i in A:
  nu *= i
for i in A:
  de += nu // i
print(nu / de)

Submission status: Accepted

Solution code:
N = int(input())
A = map(int, input().split())
sum = sum(1/a for a in A)
print(1/sum)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
x = 0
for ai in A:
    x += 1 / ai
print(1 / x)

Submission status: Accepted

Solution code:
n=int(input())
A=list(map(int,input().split()))
ans = 0
for a in A:
  ans += 1/a
print(1/ans)

Submission status: Accepted

Solution code:
import numpy as np
n=int(input())
l= [np.array(input().split() ,dtype=np.int64)]

l2=[]
for i in range(len(l)):
    l2.append(1/(l[i]))
    sum1=np.sum(l2) 
    ans=1/(sum1)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(N):
  ans += 1 / A[i]
ans = 1 / ans
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = 0
for i in a:
    b += 1 / i
print(1 / b)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
kei=0.0
for i in range(n):
    kei += 1/a[i]
print((float)(1/kei))

Submission status: Accepted

Solution code:
N = int(input())
lsA = list(map(int,input().split()))
d = 0
for i in range(N):
    d += 1/lsA[i]
print(1/d)

Submission status: Accepted

Solution code:
a=int(input())
b=list(map(int,input().split()))
d=0
for i in range(a):
  d=d+(1/b[i])
print(1/d)

Submission status: Accepted

Solution code:
# ABC138

N = int(input())
A = list(map(int, input().split()))
bunbo = 0

for a in A:
    bunbo += 1/a
print(1/bunbo)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))

nom = 1
denom = A[0]

for i in range(1, N):
    nom = nom * A[i] + denom
    denom = denom * A[i]

print(denom / nom)

Submission status: Accepted

Solution code:
def solve():
    N = int(input())
    A = list(map(int, input().split()))
    ans = 0
    A = [1 / a for a in A]
    print(1 / sum(A))
    return

solve()

Submission status: Accepted

Solution code:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


# inputna
n = int(input())
a = list(map(int, input().split()))
ans = 1/sum((1/num) for num in a)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
s = 0
for i in a:
  s += 1 / i
print(1 / s)

Submission status: Accepted

Solution code:
a = int(input())
b = list(map(int,input().split()))
A = 1
B = 0
for i in range(a):
  A *= b[i]
for i in range(a):
  B += A/b[i]
print(A/B)

Submission status: Accepted

Solution code:
n = int(input())
a =list(map(int, input().split()))
S = 0
for i in range(n):
  S += 1/a[i]
print(1/S)

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))

ans = 0
for a in A:
  ans += 1 / a
print(1/ans)

Submission status: Accepted

Solution code:
N=int(input())
d=[int(s) for s in input().split()]
x=1
for i in range(N):
    x=x*d[i]
y=0
for i in range(N):
    y+=int(x/d[i])
print(x/y)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))

ans = 0
for i in A:
    ans += 1/i

print(1/ans)

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())
    A = list(map(int, readline().split()))

    s = 0

    for x in A:
        s += 1 / x

    print(1 / s)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = [1/i for i in A]
Bs = sum(B)
ans = 1 / Bs
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))

total = 0

for i in range(n):
    total += 1/A[i]
    
print(1/total)

Submission status: Accepted

Solution code:
n=int(input())
A=list(map(int,input().split()))
s=0
for i in range(n):
  s+=1/A[i]
print(1/s)

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
s=0
for i in range(len(l)):
  s+=1/l[i]
print(1/s)

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
s=0
for i in range(N):
    s+=1/A[i]
print(1/s)