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

invlist = []

for k, v in enumerate(list):
    value = 1 / v
    invlist.append(value)

total = 0
for x in invlist:
    total += x

print (1 / total)

Submission status: Accepted

Solution code:
N = int(input())
inList = [int(s) for s in input().split(" ")]

mul = 1
for i in inList:
    mul*=i
#print(mul)
sumList = 0
for i in inList:
    sumList += mul/i
    #print(sumList)
res = mul/sumList
print(res)

Submission status: Accepted

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

bunsi=1
for i in ls:
    bunsi*=i
souseki=bunsi
bunbo=0
for i in ls:
    bunbo+=souseki/i

print(bunsi/bunbo)

Submission status: Accepted

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

Submission status: Accepted

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

    print(o)

if __name__ == "__main__":
    f_b()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

B = [0.0]*N
sum = 0.0

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

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

Submission status: Accepted

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

s = 0
for c in a :
    s += 1/c

print(1/s)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    aa = input().split(' ')
    gyakusu = map(lambda x: 1/int(x), aa)
    summ = sum(gyakusu)
    print(str(1/summ))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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 = [int(i) for i in input().split()]
r = 0
for x in a:
    r = r + 1 / x
print(1/r)

Submission status: Accepted

Solution code:
from fractions import Fraction

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

ans = 1.0 / sum([Fraction(1, ai) for ai in a])
print(ans)

Submission status: Accepted

Solution code:
import fractions
def gcd(x,y): return fractions.gcd(x,y)
def lcm(a,b): return a*b//fractions.gcd(a,b)

n=int(input())
a=[int(i) for i in input().split()]
x=a[0]
for i in range(1,n):
    x=lcm(x,a[i])
ans=chk=0
for i in a:
    ans+=x//i
print(x/ans)

Submission status: Accepted

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

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

print(1.0 / sum_a)

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:
import sys

lines = sys.stdin.readlines()

n = int(lines[0])
pieces = lines[1].strip().split(' ')
ans = 0
for i in range(n):
    ans += 1.0 / int(pieces[i])

print(1.0 / ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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

sum = 0

for i in range(N):
    sum += 1 / an[i]
print(1/sum)

Submission status: Accepted

Solution code:
from functools import reduce
from operator import mul
n = int(input())
Alist = [int(i) for i in input().split()]
a = reduce(mul,Alist)
c = 0
for i in range(n):
    c += a/Alist[i]
print(a/c)

Submission status: Accepted

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

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

main()

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
from functools import reduce
import sys
import math
import bisect
import random
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return list(map(float, sys.stdin.readline().split()))
def LS():return sys.stdin.readline().split()
def SR(n): return [list(sys.stdin.readline())[:-1] for i in range(n)]
def IR(n): return [int(sys.stdin.readline()) for i in range(n)]
def LIR(n): return [list(map(int, sys.stdin.readline().split())) for i in range(n)]
def LSR(n): return [list(map(list, sys.stdin.readline().split())) for i in range(n)]
_gcd = lambda x, y: _gcd(y, x%y) if (x%y) else y
_lcm = lambda x, y: x*y // _gcd(x, y)
def gcd(*numbers):
    return reduce(_gcd, numbers)
def lcm(*numbers):
    return reduce(_lcm, numbers)
sys.setrecursionlimit(1000000)
INF = float('inf')
mod = 1000000007
dire4 = [(1,0), (0,1), (-1,0), (0,-1)]
dire8 = [(1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1)]

N = I()
A = LI()

ans = 0

for a in A :
    ans += (1.0 / a)

print(1.0 / ans)

Submission status: Accepted

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

sum = 0
for d in data:
  sum = sum + (1/int(d))
  
print(1/sum)

Submission status: Accepted

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

Submission status: Accepted

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

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

    print('{:.6f}'.format(1/sum(1/a for a in A)))
    

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import numpy as np
import sys

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

    rev = 0
    for num in a:
        rev += 1/num
    
    print(1/rev)
        


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

Submission status: Accepted

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

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())
al=list(map(int,input().split()))
ald=[]
def cal(n):
    return 1/n
for i in al:
    ald.append(cal(i))
aldsum=sum(ald)
ans=1/aldsum
print(ans)

Submission status: Accepted

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

_sum = 0
for i in range(N):
    _sum += 1 / AA[i]

print(round(1/_sum, 10))

Submission status: Accepted

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

result = 0
for num in aryNum:
    result += 1 / num

print(1/result)

Submission status: Accepted

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

Submission status: Accepted

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

import sys

debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        lines.append(input())
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    token = lines[0].split(" ")
    n = int(token[0])

    a = [int(e) for e in lines[1].split(" ")]

    return (n, a)


def solve(n, a):

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

    result = 1 / total

    return result


def main():
    # 出力

    print("%s" % solve(*parse_input()))

if __name__ == '__main__':

    main()

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1/B
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
n = int(input())
alist = list(map(int, input().split()))
alist = np.array(alist)
gyakulist = 1 / alist
print(1/sum(gyakulist))

Submission status: Accepted

Solution code:
from decimal import *

n = int(raw_input())
a = map(int, raw_input().split())

den = Decimal(0)

for i in xrange(n):
	den += Decimal(1)/Decimal(a[i])

ans = Decimal(1)/den

print ans

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ans = 0.0
As = map(float, input().split())
for a in As:
  ans += 1/a
print(1/ans)

Submission status: Accepted

Solution code:
from fractions import Fraction

N = int(input())
A = map(int, input().split())
s = sum([Fraction(1, x) for x in A])
print(float(Fraction(s.denominator, s.numerator)))

Submission status: Accepted

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

Submission status: Accepted

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

devider = 0

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

ans = 1 / devider

print(ans)

Submission status: Accepted

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

SUM = 0

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

print(1/SUM)

Submission status: Accepted

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

for i in range(n):
    r = 1/a[i]
    ans.append(r)

ans2 = 1/sum(ans)
print(ans2)

Submission status: Accepted

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

Submission status: Accepted

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

    prod = 1
    for i in A: prod *= i
    frac = []
    for i in A:
        frac.append(prod // i)
    denom = sum(frac)
    return prod / denom

if __name__ == '__main__':
    print(main())

Submission status: Accepted

Solution code:
# -*- condig:utf-8 -*-

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

Submission status: Accepted

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

Submission status: Accepted

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

z = 0

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

print(1/z)

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
A = np.fromstring(input(), sep=' ')
ans = 1 / (1. / A).sum()
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = input().split(" ")
s = 0
for i in A:
    s += 1/int(i)
print(1/s)

Submission status: Accepted

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

Submission status: Accepted

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

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

if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) for i 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())
a_list = list(map(int, input().split()))
multi = a_list[0]
for num in a_list[1:]:
    multi *= num

total = 0
for num in a_list:
    total += multi // num

print(multi/total)

Submission status: Accepted

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

gyakusuu_wa = 0

for i in range(N):
  gyakusuu_wa += 1/An[i]

answer = 1 / gyakusuu_wa

print(answer)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
from functools import reduce


def main():
    # a, b
    n = int(input())
    a = map(int, input().split())
    print(process(n, a))


def process(n, a):
    a = map((lambda x: 1 / x), a)
    asum = reduce((lambda x, y: x + y), a)
    return 1 / asum


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#coding:utf-8
n = int(input())
a = list(map(int, input().split()))
tmp = 0

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

print(1/tmp)

Submission status: Accepted

Solution code:
n = input()
n = int(n)
a = input().split(" ")
num2 = 0
for num in a:
    num = int(num)
    num2 += 1 / num
print(1/ num2)

Submission status: Accepted

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

seki = 1

for i in range(n):
  seki  = seki * array[i]
  
wa = 0
for i in range(n):
  wa += seki/array[i]
  
  
print(seki/wa)

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
for i in range(N):
  count += 1 / lis[i]

print(1 / count)

Submission status: Accepted

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

Submission status: Accepted

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

gcd = 1
for i in A:
        gcd *= i

tmp = []
for j in A:
        tmp.append(gcd/j)

print(gcd/sum(tmp))

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

print(1 / ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

below = 0
for a in aa:
  below += 1/a
 
print(1/below)

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())
arr=list(map(int,input().split()))
sum1=1
for val in arr:
  sum1*=val
sum2=0
for i in range(n):
  tmp=1
  for j in range(n):
    if i==j:
      continue
    tmp*=arr[j]
  sum2+=tmp
print(sum1/sum2)

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())
num_list = input().split()
ans = 0
for i in num_list:
  x = 1/int(i)
  ans = ans + x

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

Submission status: Accepted

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

sum_i = 0
for x in a:
    sum_i += (1/x)
s = 1 / sum_i
print(s)

Submission status: Accepted

Solution code:
n = int(input())

an = map(int, input().split())

b = 0
for i in an:
    b += 1/i
print(1/b)

Submission status: Accepted

Solution code:
import sys

def solve(N: int, A: "List[int]"):
    result = 0.
    for i in range(N):
        result += 1./A[i]
    print(1./result)
    return


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]"
    solve(N, A)

if __name__ == '__main__':
    main()

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:
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:
# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int,input().split()))
from decimal import Decimal
a = list(map(Decimal,a))

b = [1/i for i in a]
print('{:.6f}'.format(1/sum(b)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
array = [int(i) for i in input().split()]
seki = 1
for i in range(n):
  seki  = seki * array[i]  
wa = 0
for i in range(n):
  wa += seki/array[i]
print(seki/wa)

Submission status: Accepted

Solution code:
import numpy as np

N = input()
N = int(N)
stN = str(N)
p = input().split()
p_l = [int(s) for s in p]

pn = np.array(p_l)
ones = np.ones(len(p_l))
gyaku = ones/pn
ans = sum(gyaku)
ans = 1/ans
print(ans)

Submission status: Accepted

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

sum = 0
for i in range(N):
	sum += 1.0 / float(Alis[i])
print(1.0/sum)

Submission status: Accepted

Solution code:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

n = readi()
t = readl()

s = 0
for i in t:
    s += 1 / i

print(1 / s)

Submission status: Accepted

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

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

Submission status: Accepted

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

ssum = 0
for s in ss:
    ssum += 1 / s
print(1 / ssum)

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

Submission status: Accepted

Solution code:

def solve():
    N = int(raw_input())
    A = [int(_) for _ in raw_input().split()]
    revSum = 0.0
    for i in range(N):
        revSum += 1.0 / A[i]
    print 1.0 / revSum

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

for i in a:
    result += 1./i

print(1/result)

Submission status: Accepted

Solution code:
import math;

def swap(a,b):
    return (b,a)

def gcd(a,b):
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

xm = [1,0,-1,0]
ym = [0,1,0,-1]

def bfs(y,x):
    if (y==gy and x==gx):
        return
    for i in range(4):
        for j in range(4):
            if (c[y+ym[i]][x+xm[j]]=='#'):
                continue
            if (aom[y+ym[i]][x+xm[j]]!=-1):
                continue
            aom[y+ym[i]][x+xm[j]] = aom[y][x] + 1

def main():
    n = int(input())
    a = [x for x in map(int,input().split())]
    x = 0
    for i in a:
        x += 1 / i
    ans = 1 / x
    print(ans)
    return

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
# スペース区切りの整数の入力
l = list(map(int, input().split()))
print(max(l)/sum([max(l)/i for i in l]))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(1/ans)

Submission status: Accepted

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

Submission status: Accepted

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

below = 0
for i in range(N):
    below += 1 / A_array[i]

print(1/below)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
N = int(input())
A = list(map(int, input().split()))

M = []
prod = 1
for a in A:
    prod *= a

for a in A:
    M.append(prod / a)

ans = prod / sum(M)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(1 / inv)

Submission status: Accepted

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

print(1/ss)

Submission status: Accepted

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


x = 1
for i in a:
    x = x * i

Y = []

for i in range(n):
    tmp = 1
    for j in range(n):
        if(i!=j):
            tmp = a[j] * tmp
    Y.append(tmp)

sum_y = 0
for i in Y:
    sum_y = sum_y + i

print(x/sum_y)

Submission status: Accepted

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

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

print(str(1/sum_num))

Submission status: Accepted

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

print(1/x)

Submission status: Accepted

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

print(1/sum(AN))

Submission status: Accepted

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

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

print(1/ans)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    n = int(input())
    result = 1 / sum([1.0 / int(i) for i in input().split()])
    print(result)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    xs = input().split()
    prod = 1
    for i in range(N):
        prod *= int(xs[i])
    sum = 0
    for i in range(N):
        sum += prod / int(xs[i])
    print(prod / sum)
    return


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(float, input().split()))
s = sum(map(lambda e: 1.0 / e, a))
print(1.0 / s)

Submission status: Accepted

Solution code:
import sys,heapq,math,resource
from collections import deque,defaultdict
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True # and False
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

def setrlim():
  sys.setrecursionlimit(250000)
  soft,hard = resource.getrlimit(RLIMIT_STACK)
  # setrlimit works on ubuntu (and atcoder), but not on WSL
  #resource.setrlimit(RLIMIT_STACK, (128*1024*1024,hard))

n = inn()
a= inl()
sum = 0.0
for i in range(n):
    sum += 1.0/a[i]
print(1/sum)

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

Submission status: Accepted

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

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

ans = 0
for a in A:
    gyakuA = 1/a
    ans += gyakuA

print(1/ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(1 / inv_sum)

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) for i in input().split()] 
C = 0.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()))
tmp = 0
for i in range(n):
    tmp += 1 / a[i]

print(1/ tmp)

Submission status: Accepted

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

sum=0
for num in a:
    sum+=1/num

print(1/sum)

Submission status: Accepted

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

sum = 0.0
for a in arr:
    sum += (1/a)
ans = 1.0 / sum
print(ans)

Submission status: Accepted

Solution code:
import fractions
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

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

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

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


l = lcm(*A)
#print(l)

ans = 0.0
for i in range(N):
    ans += float(l) / float(A[i])

ans = l/ans
if ans%1 == 0:
    ans = int(ans)

print(ans)

Submission status: Accepted

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

print(1/np.sum(1/A))

Submission status: Accepted

Solution code:
n = int(input().strip())

array = list(map(int, input().strip().split(' ')))
x = 0
for i in range(n):
    x = x + (1/array[i])
ans = 1/x

print(ans)

Submission status: Accepted

Solution code:
#coding: utf-8

N = int(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()))
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())
s=[int(i) for i in input().split()]
v=0
for i in s:
  v+=1/i
print(1/v)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
A=input().split()
for i in range(N):
    A[i]=1/int(A[i])
print(1/sum(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()))
suma=0
for a in A:
  suma+=1/a
print(1/suma)

Submission status: Accepted

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

print(1.0/ans)

Submission status: Accepted

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

s = 0

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

Submission status: Accepted

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

print(1/sum(n_list))

Submission status: Accepted

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

parts_mul_A = list(map(lambda x: int(mul_A/x),A))
#print(parts_mul_A)
ans = mul_A/sum(parts_mul_A)
print(ans)