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: Accepted

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

a = [float(i) for i in a]#リストの型変換

i = 0
sum = 0
for a_f in a:
    a[i] = 1 / a_f
    sum = sum + a[i]
    i += 1

sum = 1 / sum

print(sum)

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int, input().split()))
s = sum(1/x for x in v)
print(1/s)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
# import math
# import numpy as np
# from functools import lru_cache

from functools import reduce    # リストの積を作りたい時とか
# reduce(lambda a, b: a * b, array)

from collections import deque

args = sys.argv
if len(args) == 2:
  from IPython import embed
  em = True
else:
  em = False

# sys.setrecursionlimit(10000)

#### input
N = int(input())
# a, b = map(int, input().split())
As = list(map(int, input().split()))

if N == 1:
  print(As[0])
  exit()
# a = list(map(lambda x: int(x)*(-1), a))  # 各要素を-1倍


# n = int(input())
# t = [int(input()) for i in range(n)]
if em: sys.stdin = open('/dev/tty')

#### function
numerator = reduce(lambda a, b: a * b, As)

denominator = 0
for i in range(0, N):
  tmp = As.pop(0)
  denominator = denominator + reduce(lambda a, b: a * b, As)
  As.append(tmp)

print(numerator / denominator)
# @lru_cache(maxsize=10000)

#### process
# if em: embed()

## heapsort, O(NlogN)
# import heapq
# heapq.heapify(A)
# min = heapq.heappop(A)
# heapq.heappush(A, new_element)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = list(map(int, input().rstrip('\n').split()))
    t = 0
    for i in range(n):
        t += (1 / a[i])
    print(1 / t)


if __name__ == '__main__':
    slove()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
import numpy as np

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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import Fraction

if __name__ == '__main__':

	input()

	A = list(map(int,input().split()))

	a = 0
	for i in A:
		a += Fraction(1,i)

	print(float(Fraction(1,a)))

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()))
s=0
for i in range(n):
      s+=1/a[i]
print(1/s)

Submission status: Accepted

Solution code:
N = int(input())
A = [int(x) for x in input().split()]
B = [0] * N
for i in range(N):
    B[i] = 1 / A[i]
ans1 = sum(B)
ans = 1 / ans1
print(ans)

Submission status: Accepted

Solution code:

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

#分母となる変数
ans = 0

#1/Aを次々に計算していき、分母を求めます
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()))

top = 1
for a in A:
    top = top * a

bottom = 0
for i in range(N):
    bottom += top / A[i]

ans = top / bottom
print(round(ans, 6))

Submission status: Accepted

Solution code:

def main():
    N = input()
    A = [int(x) for x in input().split()]
    total_bunbo = 0
    for a in A:
        total_bunbo += 1/a
    ans = 1/total_bunbo
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(0,N):
  A[i] = 1/float(A[i])
ans = sum(A)
print 1/ans

Submission status: Accepted

Solution code:
# coding: utf-8
N = int(input())
A = list(map(int, input().split()))
a=0
for i in A:
    a+=1/i
print(1/a)

Submission status: Accepted

Solution code:
n = int(input())
input_lst = list(map(int,input().split()))
t = 0
#print(n)
#print(a)

for i in input_lst:
    t = t + 1/i

res = 1/t

print(res)

Submission status: Accepted

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


def inverse(x):
    return 1 / x


print(1 / sum(map(inverse, a)))

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]

ans = 1 / S
print('{:.6g}'.format(ans))

Submission status: Accepted

Solution code:
a=int(input())
x=input()
X=x.split()
ans=0
answer=0
for i in range(len(X)):
    ans=float(ans+1/int(X[i]))
answer=1/ans
print(answer)

Submission status: Accepted

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

for i in A:
  tmp1 = tmp1 + 1/i

ans = 1 / tmp1
print(ans)

Submission status: Accepted

Solution code:
import numpy as np
n = int(input())
a = np.array(list(map(int,input().split())))
one = np.repeat(1,n)
rec = one/a
recsum = sum(rec)
ans = 1/recsum
print(ans)

Submission status: Accepted

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

sum = 0
for i in range(N):
    sum += 1/a[i]

ans = 1/sum

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
intlist = input().split(' ')

sum = 0

for i in intlist:
    sum += 1/int(i) 

print(1/sum)

Submission status: Accepted

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

Submission status: Accepted

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

print(1/float(sum))

Submission status: Accepted

Solution code:
from functools import reduce

if __name__ == "__main__":
    n = int(input())
    a = list(map((lambda x: 1/int(x)), input().split()))
    res = 1/reduce((lambda x, y: x + y), a)
    print(res)

Submission status: Accepted

Solution code:
N=int(input())
A=[int(x) for x in input().split()]

Y=0

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

print(1/Y)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

seki = 1
for a in A:
    seki *= a

wa = 0
for a in A:
    wa += seki//a

print (seki/wa)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(1/sum)

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_l = list(map(int, input().split()))
A_l_inv = [1/x for x in A_l] 

print(1/(sum(A_l_inv)))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
oppai=int(input())
op_list=list(map(int,input().split()))
f=0

for i in op_list:
  f += 1/i
  
print(1/f)

Submission status: Accepted

Solution code:
_ = int(input())
a_list = list(map(int, input().split()))

f = 0

for a in a_list:
    f += 1/a

print(1/f)

Submission status: Accepted

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

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

print(1/a)

Submission status: Accepted

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

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

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:
def solve():
    N, *al = map(int, open(0).read().split())
    
    ans = 1 / sum(map(lambda x:1/x, al))
    
    print(ans)

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
sum = 0
for i in A:
    sum += 1/i

print(1/sum)

Submission status: Accepted

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

ans = []
for i in range(n):
    ans += [a[i] ** -1]

print(sum(ans) ** -1)

Submission status: Accepted

Solution code:
N=int(input())

A=list(map(int,input().split()))

di=0

for a in A:
    di+=1/a

print(1/di)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 =[int(_) for _ in input().split()]

for i in range(len(a)):
  a[i] = 1/a[i]
b = sum(a)
print(1/b)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n):
    AS[i] = 1 / AS[i]
ans = 1 / sum(AS)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

denominator = 0

for i in a:
  denominator += 1 / i

print(1 / denominator)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys,collections,itertools,re,math,fractions,decimal,random,array,bisect,heapq

# decimal.getcontext().prec = 50
# sys.setrecursionlimit(10000)
# MOD = 10**9 + 7

def solve(f):
    n = f.read_int()
    a = f.read_int_list()

    return 1.0 / sum([1.0/ai for ai in a])


class Reader(object):
    def __init__(self, filename=None):
        self.file = open(filename) if filename is not None else None
        self.case = 1

    def __readline(self):
        return self.file.next().strip() if self.file else raw_input()

    def next_case(self):
        self.file.next()
        self.case += 1

    def read_int(self): return int(self.__readline())
    def read_float(self): return float(self.__readline())
    def read_long(self): return long(self.__readline())
    def read_decimal(self): return decimal.Decimal(self.__readline())
    def read_str(self): return self.__readline()

    def read_int_list(self): return map(int, self.__readline().split())
    def read_float_list(self): return map(float, self.__readline().split())
    def read_long_list(self): return map(long, self.__readline().split())
    def read_decimal_list(self): return map(decimal.Decimal, self.__readline().split())
    def read_str_list(self): return self.__readline().split()

if __name__ == '__main__':
    filename = sys.argv[1] if len(sys.argv) > 1 else None
    f = Reader(filename)
    if f.file:
        while True:
            print "Case #%d\n"%f.case, solve(f)
            try:
                f.next_case()
            except StopIteration:
                break
    else:
        print solve(f)

Submission status: Accepted

Solution code:
n = int(input())

li = [1/float(i) for i in input().split()]
print(1/sum(li))

Submission status: Accepted

Solution code:
import numpy as np
N=int(input())
A=list(map(int,input().split()))

A=np.array(A)
B=sum(1/A)
print(1/B)

Submission status: Accepted

Solution code:
from __future__ import print_function
# import numpy as np
# import numpypy as np
import sys
input = sys.stdin.readline

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd

def lcm(n,m):
    return int(n*m/gcd(n,m))

import re
import array
import copy
import functools
import operator

import collections
import itertools
import bisect
import heapq


from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace

from queue import PriorityQueue as pq

def reduce(p, q):
    common = fractions.gcd(p, q)
    return (p//common , q//common )
# from itertools import accumulate
# from collections import deque

import random


def main():
    n = int(input())
    a = list(map(int, input().split()))
    aaa=1
    a_sum=0
    for index in range(len(a)):
        aaa = aaa * a[index]
        a_sum = a_sum + a[index]

    a_numerator = 0
    for index in range(len(a)):
        a_fac = aaa // a[index]
        a_numerator += a_fac
        
        
            
    print(aaa / a_numerator)
    return

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import operator
import itertools

N = int(input())
A = map(int, input().split())

print(1/sum(map(operator.truediv, itertools.repeat(1), A)))

Submission status: Accepted

Solution code:
from fractions import Fraction
from functools import reduce
N=int(input())
L=map(int,input().split())
A = (Fraction(1, x) for x in L)
ANS = reduce(lambda x, y: x + y, A)
print(float(Fraction(1,ANS)))

Submission status: Accepted

Solution code:
import decimal

n = int(input())
arr = list(map(int, input().split()))

s = decimal.Decimal(0)

for i in range(n):
    s += decimal.Decimal(1 / arr[i])

ans = decimal.Decimal(1 / s)

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

def b(x):
    x=int(x)
    x = 1/x
    return x
a = list(map(b,input().split()))



res = sum(a)
print(1/res)

Submission status: Accepted

Solution code:
N,*A=map(int, open(0).read().split())
for i in range(N):
    A[i] = 1/A[i]
print(1/(sum(A)))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a = II()
    s = input()
    print(s if a >= 3200 else "red")
    return

#B
def B():
    II()
    a = LI()
    ans = 0
    for ai in a:
        ans += 1 / ai
    print(1/ans)
    return

#C
def C():
    n = II()
    v = LI()
    q = []
    for vi in v:
        heappush(q, vi)
    while 1:
        a = heappop(q)
        if q:
            b = heappop(q)
            heappush(q, (a + b) / 2)
        else:
            print(a)
            return

#D
def D():
    n, q = LI()
    tree = [[] for i in range(n)]
    for _ in range(n - 1):
        a, b = LI_()
        tree[a].append(b)
        tree[b].append(a)
    ans = [0] * n
    c = defaultdict(int)
    def dfs(now):
        for nex in tree[now]:
            if c[nex]:
                continue
            c[nex] += 1
            ans[nex] += ans[now]
            dfs(nex)
    for _ in range(q):
        p, x = LI_()
        x += 1
        ans[p] += x
    c[0] = 1
    dfs(0)
    print(*ans)
    return

#E
def E():
    return

#F
def F():
    return

#Solve
if __name__ == '__main__':
    B()

Submission status: Accepted

Solution code:
N=int(input())

a=list(map(int,input().split()))

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

Submission status: Accepted

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

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()))

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

print(1/a_1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
al1= input().split(" ")

for j in range(len(al1)):
  al1[j] = int(al1[j])

al2 = []

for i in range(len(al1)):
  al2.append(1/al1[i])
  
print(1/sum(al2))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
result = 0

for i in map(int, input().split()):
  result += 1 / i
  
print(1 / result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
lista = list(map(int, input().split()))
ans=0

for i in range(n):
  ans=ans+1/lista[i]
  
ans1=1/ans

print(ans1)

Submission status: Accepted

Solution code:
n = int(input())

div_list = [ (1 / x) for x in list(map(int, input().split())) ]

print(1 / sum(div_list))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
l=[1/int(i) for i in input().split()]
r=sum(l)
print("{:.15f}".format(1/r))

Submission status: Accepted

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

Submission status: Accepted

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

r = 0
for a in A:
  r += 1 / a
  
r = 1 / r

print(r)

Submission status: Accepted

Solution code:
n = int(input())
a =list(int(e) for e in input().split())
v =0
for  i in range(n):
    v+=1 / a[i]
    

print(1/v)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, *A = map(int, open(0).read().split())
print('{:.14f}'.format(1.0 / sum([1.0 / a for a in A])))

Submission status: Accepted

Solution code:
#abc138B - Resistors in Parallel
N = int(input())
A = list(map(int,input().split()))
AA = []
for i in range(N):
    AA.append(1/A[i])
S = sum(AA)
print(1/S)

Submission status: Accepted

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

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()))
S = 0
for a in A:
    S += 1/a
print(1/S)

Submission status: Accepted

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

total_r = 0

for num in A:
    total_r += 1 / num

print(1 / total_r)

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])

print(1/ans)

Submission status: Accepted

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

bunbo = 0
for i in A:
   bunbo += float(1/i)

print(float(1/bunbo))

Submission status: Accepted

Solution code:
n = int(input())

a = [int(i) for i in 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 = input()
list1 = list(map(int,a.split()))
b = 0
for i in range(n):
    b += 1/list1[i]

b = 1/b
print(b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

bunbo = 0
for a in arr:
    bunbo += 1/a

res = 1 / bunbo
print(res)

Submission status: Accepted

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

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:
import sys
input = sys.stdin.readline

N = int(input())
lis_a = list(map(int, input().split()))

c = 0
for i in lis_a:
    c += 1/i

print(1/c)

Submission status: Accepted

Solution code:
input()
print(1.0/sum([1.0/int(x) for x in input().split()]))

Submission status: Accepted

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

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

Submission status: Accepted

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

bunbo = 0
for a in A:
    bunbo += 1/a

print(1/bunbo)

Submission status: Accepted

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

div_list = [0] * n

for i in range(len(list)):
  div_list[i] = 1 / list[i]
  
sum = 0
for i in range(len(list)):
  sum += div_list[i]
  
print( 1 / sum )

Submission status: Accepted

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

product_list = [1]*n

for i in range(len(list)):
  for j in range(len(list)):
    if i != j :
      product_list[i] *= list[j]
  
product_sum = 0
for i in range(len(list)):
  product_sum += product_list[i]
  
total_product = product_list[0] * list[0]

print( total_product / product_sum)

Submission status: Accepted

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

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

Submission status: Accepted

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

reci_sum = sum([1/ai for ai in A])
print(1/reci_sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
_=input()
number2=input()
numbers=number2.split()
answer=0
for number in numbers:
    x=1/float(number)
    #answer+=x
    answer=answer+x
print(1/answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

S = 0

for i in range(N):
  S += 1 / int(data[i])

print(1 / S)

Submission status: Accepted

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

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(" ")))

s = 0.0
for i in a:
  s += 1 / i

print(1 / s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = float(input())
A = list(map(float, input().split()))
j = float(0)
ans = float(0)
for i in A:
    j += 1/i
ans = 1/j
print(ans)

Submission status: Accepted

Solution code:
repeat =int(input())
numbers =input().rstrip().split(" ")
#print(numbers)
sum =0
for i in range(repeat):
  sum =sum +1/int(numbers[i])
#print(sum)
answer =1/sum
print(answer)

Submission status: Accepted

Solution code:
N = int(input())
A = [int(x) for x in input().split()]

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

print(1/sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
a=int(input())
N = input()
N =N.split(' ')
for i in range(int(a)):
    N[i]=int(N[i])
    #print(N[i]," ",end="")
#print()

b=0
for i in range(int(a)):
    #print(1/N[i])
    b=b+(1/N[i])
#print(b)
print(1/b)

Submission status: Accepted

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

inv = 0

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

Submission status: Accepted

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


a = []
for i in A:
	i = 1/i
	a.append(i)
	
b = sum(a)

c = 1 / b

print(c)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
child = 1
for val in A:
    child *= val
mother = 0
for val in A:
    mother += child // val

print(child / mother)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    nums = list(map(int, input().split()))
    print('{:.16g}'.format(1 / sum(1 / x for x in nums)))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
try:
    N = int(input())
    if N>0 or N<=100:
        S = input()
        A = S.split()
        A = list(map(int, A)) 
 
        sum1 = 1/A[0]
 
        for i in range(0,N-1):
         sum1 = sum1 + 1/A[i+1]
 
        result = 1/sum1
        print(result)

except:
        print("Error")

Submission status: Accepted

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

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

ans = 1 / ans

print(ans)

Submission status: Accepted

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


ans = 0
for i in range(len(a)):
    ans += 1/a[i]
    
ans = 1/ans

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:
from sys import stdin
n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
s = 0
for i in range(n):
    s += 1/li[i]
print(1/s)

Submission status: Accepted

Solution code:
#問題文
#N個の整数の列A1,…,ANが与えられます
#これらの逆数の総和の逆数 を求めてください。
#
#制約
#1≤N≤100
#1≤Ai≤1000

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()))

divsumA = 0

for a in A:
  divsumA += 1/a

print(1/divsumA)

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 = map(int, input().split())
ans = 0
for a in A:
    ans += 1/a
print(1/ans)