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

def resolve():
    N = int(input())
    A = list(map(int, input().split()))

    print(1/sum([1/i for i in A]))

if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
import sys

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))


n=II()
A=LI()
x=0
for i in range(n):
    x+=1/A[i]
x=1/x
print(x)

Submission status: Accepted

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

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

print(1/anc1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

sum = 0

for a in A:
    sum += 1.0 / a
    
print(1.0 / sum)

Submission status: Accepted

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

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())
A=[int(_) for _ in input().split()]
print('{:.16g}'.format(1/sum(1/x for x in A)))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
d = list(map(float, 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 = list(map(int,input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(1/sum)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def q2():
    N = int(input())
    A = [int(i) for i in input().split()]
    ans = sum(map(lambda x: 1/x, A))
    print('{0:.5f}'.format(1/ans))


if __name__ == '__main__':
    q2()

Submission status: Accepted

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

import fractions

#最小公倍数
ans = a[0]
for i in range(1, N):
    ans = ans * a[i] // fractions.gcd(ans, a[i])


res = ans
denominator = 0

for i in range(N):
    denominator += ans/a[i]

print(res/denominator)

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())
A = list(map(int, input().split()))
inv = sum([1/a for a in A])
print(1/inv)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
A = list(map(int, input().split()))
A = np.array(A)

def calc(A):
  return 1/sum(1/A)
  
ans = calc(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:
n = int(input())
a = list(map(int,input().split()))
v = 1
for i in a:
  v *= i
s = 0
for i in a:
  s += v//i
print(v/s)

Submission status: Accepted

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

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

new = 1/old
print(new)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, *a = map(int, open(0).read().split())

up = 1
for num in a:
    up *= num

down = 0
for i in range(n):
    cnt = 1
    for j in range(n):
        if j != i:
            cnt *= a[j]
    
    down += cnt
    
print(up / down)

Submission status: Accepted

Solution code:
import sys
stdin=sys.stdin

ns=lambda:input().rstrip()
ni=lambda:int(input().rstrip())
nm=lambda:map(int,input().split())
nl=lambda:list(map(int,input().split()))

N=int(input())
A=nl()
A_inv=[1/A[i] for i in range(len(A))]
print(1/sum(A_inv))

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())
A = [ int(_) for _ in 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()))
bunbo = 0
for i in range(len(l)):
    bunbo += 1 / l[i]
print(1 / bunbo)

Submission status: Accepted

Solution code:
n = int(input())
a = [1/int(i) for i in input().split()]
print('{:.7f}'.format(1/sum(a)))

Submission status: Accepted

Solution code:
from functools import reduce

N = int(input())
A = input()
A = map(lambda Ai: int(Ai), A.split())

sum = lambda list: reduce(lambda x, y: x + y, list, 0)
reciprocal = lambda value: 1 / value

reciprocal_A = map(reciprocal, A)
sum_reciprocal_A = sum(reciprocal_A)
answer = reciprocal(sum_reciprocal_A)

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print('{:.6f}'.format(1/ans))

Submission status: Accepted

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

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

print(1/ans)

Submission status: Accepted

Solution code:
#
# Written by NoKnowledgeGG @YlePhan
# ('ω')
#
#import math
#mod = 10**9+7
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
  
def main():
  n = int(input())
  A = list(map(int,input().split()))
  
  ans = 0
  for i in range(n):
    ans += 1/A[i]
  inv = 1/ans
  print(inv)
if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
int(input())
print(1 / sum(1/int(num) for num in input().split()))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys
# import math
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import product                # product(iter, repeat=n)
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from fractions import gcd                    # for Python3.4.3


def main():
    mod = 10000007                  # 10^9+7
    inf = float('inf')
    input = sys.stdin.readline      # 改行文字が残ることに注意
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def ii():  return int(input())
    def mi():  return map(int, input().rstrip().split())
    def lmi(): return list(map(int, input().rstrip().split()))
    def li():  return list(input().rstrip())
    
    
    n = ii()
    a = lmi()
    print(1 / sum(list(map(lambda x: 1/x, a))))

if __name__ == "__main__":
    main()

Submission status: Accepted

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

mul_A = 1

for i in range(N):
    a = list_A[i]
    mul_A = mul_A * a
    
sum_A = 0

for i in range(N):
    a = mul_A // list_A[i]
    sum_A = sum_A + a
    
print(mul_A/sum_A)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
_ans = 0
for x in range(n):
    _ans += 1/a[x]
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+=a[i]**-1
print(ans**-1)

Submission status: Accepted

Solution code:
input()
print(1 / sum(1 / int(num) for num in input().split()))

Submission status: Accepted

Solution code:
n=int(input())
#a,b=map(int,input().split())
al=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

ans=0

for i in range(n):
    ans+=1.0/al[i]

ans=1.0/ans

print('{:.9f}'.format(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

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

if __name__ == '__main__':
    a = int(input())
    b = [int(i) for i in input().split()]

    count =Decimal(0)

    for i in b:
        count = count +(Decimal(1) / Decimal(i))

    print(Decimal(1) / Decimal(count))

Submission status: Accepted

Solution code:
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()))

#print(N,A)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())

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

bunbo = 0

for i in t:
    bunbo += 1/i
print(1/bunbo)

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
sum=0
i=0
while i<=N-1:
  sum+=1/A[i]
  i+=1
rev=1/sum
print(rev)

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

def main():
    N = int(input())
    A = input_nums()
    print(1/sum([1/a for a in A]))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    l=LIST()
    temp=0
    for i in l:
        temp+=(1/i)
    print(1/temp)
if __name__ == '__main__':
    do()

Submission status: Accepted

Solution code:
N = int(input())
total = 0
num = 0
num = [1 / int(x) for x in input().split()]
for x in range(N):
  total += num[x]
print(1/total)

Submission status: Accepted

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

Submission status: Accepted

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

A1 = 0

for i in A:
    A1 += 1 / i

print(1 / A1)

Submission status: Accepted

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

for i in range(n):
  a[i]=a[i]/(a[i]**2)
b=sum(a)

print('{:.12g}'.format(b/(b**2)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
A = iil()

prod = 1
for item in A:
    prod *= item

frac = 0
for item in A:
    frac += prod//item

print(prod/frac)

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 = list(map(int, input().split()))
mapped = list(map(lambda x: 1/x, a_list))
print(1 / sum(mapped))

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, 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()))
s=0
for i in range(n):
  s+=1.0/a[i]
print(1.0/s)

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in a:
  ans = ans + 1/i
  
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:
n = int(input())
a = [int(x) for x in input().split()]
t = 1
for i in range(n):
    t *= a[i]
b = 0
c = 1
for i in a:
    b += t//i
    c *= i
print(c/b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(N: int, A: "List[int]"):
    from fractions import Fraction
    return float(Fraction(1, sum(Fraction(1, a) for a in A)))


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(solve(N, A))

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]
print(1/sum(b))

Submission status: Accepted

Solution code:
def resolve():
    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)
resolve()

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1 / result

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
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 = 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]
  
print(1/ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import Fraction

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

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

print(float(x.denominator / x.numerator))

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())
ans = 0
a = list(map(int,input().split()))

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

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

    print(1/ans)



if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

main()

Submission status: Accepted

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

print(1/a)

Submission status: Accepted

Solution code:
#%%
import sys
def input():
    return sys.stdin.readline().rstrip()

def main():
    N = int(input())

    print(1/sum([1/int(x) for x in input().split()]))


# %%
if __name__ == '__main__':
    main()

# %%
# from atcoder_test import doTest
# doTest("abc138","b",main)

Submission status: Accepted

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

print("{:.9f}".format(1 / sum(A)))

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0.0

for a in A:
  ans += 1.0/a
  
print(1.0/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:
import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
A = np.array(lr())
answer = 1 / sum(1 / A)
print('{:.10f}'.format(answer))

Submission status: Accepted

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

Submission status: Accepted

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

m = 1
l = 0
for i in range(n):
    m = m * a[i]

for i in range(n):
    t = m / a[i]
    l += t

print(m/l)

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:
n = int(input())
a = list(map(int, input().split()))

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

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 = [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())
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:
# Problem B - Resistors in Parallel

# input
n = int(input())
a_list = list(map(int, input().split()))

# initialization
tmp_sum = 0

# sum
for a in a_list:
    tmp_sum += 1 / a

# output
print(1 / tmp_sum)

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

Submission status: Accepted

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

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 = input()
x = map(int,raw_input().split())
s = 0
for i in x:
    s += 1.0/i
print 1.0/s

Submission status: Accepted

Solution code:

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

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

print(1/wa)

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:
#B Tesistors in Parallel
n=int(input())
a=list(map(int,input().split()))
sum=0
for i in a:
    sum+=1/i
print(1/sum)

Submission status: Accepted

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

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(1/b)

Submission status: Accepted

Solution code:
# from math import factorial,sqrt
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import scipy as scp

# 入力の受け取り
n = int(input())
arrA = list(map(int,input().split()))

bunsi = 1
for i in arrA:
    bunsi *= i

bunbo = 0
for i in arrA:
    bunbo += bunsi/i

ans = bunsi/bunbo

print(ans)
# print("{:.10f}".format(ans))
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(1/s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
B - Resistors in Parallel
https://atcoder.jp/contests/abc138/tasks/abc138_b

"""
import sys


def solve(resistors):
    res = 0
    for r in resistors:
        res += 1 / r
    return 1 / res


def main(args):
    N = int(input())
    resistors = [int(a) for a in input().split()]
    ans = solve(resistors)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math

n = int(input())

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

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

print(1/rec_sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = A[0]
mother = A[0]
child = 1

for a in A[1::]:
    child = mother + a * child
    mother *= a
    if mother % child == 0:
        common = mother // child
        mother //= common
        child //= common

print(mother/child)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#整数の入力
N = int(input())

#複数の入力
input_list = input().split( )

ans = 0
for i in range(N):
  ans = ans + 1/int(input_list[i])
  
ans = 1/ans


print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
_ = input()
print("{:.16g}".format(1 / sum(1 / x for x in map(int, input().split()))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
from fractions import gcd
n = int(input())
a = list(map(int, input().split()))
def lcm(x, y):
	return (x * y) // gcd(x, y)
b = a[0]
for i in a[1:]:
	b = lcm(b,i)

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

Submission status: Accepted

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

for i in range(n):
    ing_total+= 1 / lis[i]

print(1/ing_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 = [int(i) for i in input().split()]
ans = 0
for i in range(N):
    k = 1/A[i]
    ans+=k
print(1/ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(solve())

Submission status: Accepted

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

Submission status: Accepted

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

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

print(1/cal)

Submission status: Accepted

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

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

print(1/a)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(1/S)

Submission status: Accepted

Solution code:
input();print(1/sum(1/i for i in map(int,input().split())))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) for i in 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()))

b = 0
for x in a:
  b += 1 / x

print(1 / b)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

denominator = 0

for ai in A:
    denominator += 1 / ai

print(1 / denominator)