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

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

x=1/y
print(x)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from operator import mul
from functools import reduce

n = int(input())
a = list(map(int, input().split()))
mul_all = reduce(mul, a)
sum_all = 0
ans = 0
for i in range(n):
  sum_all += ( mul_all / a[i] )
ans = mul_all / sum_all

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(1/S)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1 / s
print(round(ans, 10))

Submission status: Accepted

Solution code:
import math
n = int(input())
result = float(0)
ni = [float(e) for e in input().split()]

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

print(1/result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
A = np.array(input().split(' '), float)

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

print(1/SUM)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
value = [tuple(map(int,input().split())) for i in range(2)]
lis = []
new_v = 0

for i in range(value[0][0]):
    lis.append(value[1][i])

for i in range(len(lis)):
    i = 1 / lis[i]
    new_v += i

print(1 / new_v)

Submission status: Accepted

Solution code:
import numpy as np

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

print(np.reciprocal(np.sum(np.reciprocal(A))))

Submission status: Accepted

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

Submission status: Accepted

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

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

print(1/sum_reverse)

Submission status: Accepted

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

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

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

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

    return (up / down)

print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions


def main():
    _ = int(input())
    xs = [fractions.Fraction(int(a), 1) for a in input().split()]
    s = float(1 / sum(1 / x for x in xs))
    print("{:.12f}".format(s))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
S = 1
T = 0
for a in A:
	S *= a
for a in A:
	T += S/a
print(S/T)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import Fraction

N = int(input())
A = [int(x) for x in input().split()]
tmp = []
for n in A:
    tmp.append(Fraction(1, n))

print(float(Fraction(1, sum(tmp))))

Submission status: Accepted

Solution code:
n=int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions
import math
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_list(a)
s=[]
m=1
for i in a:
    li=l//i
    s.append(li)
su=sum(s)
ans=l/su
print('{:.9f}'.format(ans))

Submission status: Accepted

Solution code:
import numpy

N = int(input())
li = list(map(float, input().split()))

ans = sum(numpy.reciprocal(li))
print(numpy.reciprocal(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(str(1/s))

Submission status: Accepted

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

Ans = 1 / bunbo
print(Ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
row1 = np.array(list(map(int,input().split())))

row2 = 1 / row1
print(1 / sum(row2))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = int(input())
childs = list(map(int, input().split()))
add = 0
for i in childs:
    add += 1/i
print(1/add)

Submission status: Accepted

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

s = 1.0 / s
print('{:.9f}'.format(s))

Submission status: Accepted

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

li1 = []

for i in a:
    a_re = 1/i
    li1.append(a_re)

sum_a = sum(li1)
print(1/sum_a)

Submission status: Accepted

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

def multi_all(A):
  s = 1
  for a in A:
    s *= a
  return s

M = multi_all(A)

if N == 1: print(A[0])
else:
  S = 0
  for a in A:
    S += M / a
  print(M/S)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    n = int(input())
    A = list(map(int,input().split()))
    reverse_A = map(lambda x: 1/x, A)
    print(1/sum(reverse_A))

Submission status: Accepted

Solution code:
from fractions import gcd
from functools import reduce
N = int(input())
A = list(map(int, input().split()))

# make lcm
def lcm_base(x, y):
    return (x * y) // gcd(x, y)

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

x = lcm_list(A)
y = 0
for a in A:
    y += x / a
if y == 0:
    print("NG!")
else:
    print(x / y)

Submission status: Accepted

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

bunbo = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

all_sum = 0

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

ans = 1 / all_sum

print(ans)

Submission status: Accepted

Solution code:
import fractions
import math

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

bunbo = 0

for i in A:
    bunbo += float(fractions.Fraction(1, i))

print(1/bunbo)

Submission status: Accepted

Solution code:
import fractions as fr
from functools import reduce

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

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

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

Submission status: Accepted

Solution code:
import sys


def main():
    n = int(sys.stdin.readline().strip())
    a = [int(s) for s in sys.stdin.readline().strip().split()]
    # a = [1000] * 100

    multi_all = 1
    for ai in a:
        multi_all *= ai

    divider = 0
    for ai in a:
        divider += multi_all / ai

    print(multi_all / divider)


main()

Submission status: Accepted

Solution code:
N = input()
A = list(map(int, input().split()))
l = [1]*int(N)

array_multiple = list(map(lambda x,y: x/y, l, A))

print(1/(sum(array_multiple)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
a = input().split()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

bunbo = 0
for i in range(n):
    tmp = 1
    for j, x in enumerate(a):
        if j != i:
            tmp *= x
    bunbo += tmp

print(bunshi/bunbo)

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
a = na()
b = [1/i for i in a]
print(1/sum(b))

Submission status: Accepted

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

Submission status: Accepted

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

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

#print(round(1/gyaku, 5))
print(1/gyaku)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce

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

g = reduce(lambda x, y: x * y, la, 1)

# 分子
lp = list(map(lambda x: g / x, la))

p = sum(lp)

print(1/(p/g))

Submission status: Accepted

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

Submission status: Accepted

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

d = 0
m = 1

for x in range(n):
    num = 1
    for y in range(n):
        if x != y:
            num *= a[y]

    d += num
    m *= a[x]

print(m / d);

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())

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

ue = 1

for aa in a:
    ue *= aa

shita = 0

for aa in a:
    shita += ue / aa

print(ue / shita)

Submission status: Accepted

Solution code:
n = int(input())

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

p = 1

for a in arr:
        p *= a

sum_ele = 0

for a in arr:
        sum_ele += (p//a)

res = p/sum_ele

print (res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x = 0.0
for i in a:
  x += 1.0 / i

print(1.0/x)

Submission status: Accepted

Solution code:
def solve(n, a):
    prod = 1
    for a_i in a:
        prod *= a_i
    dev = 0
    for a_i in a:
        dev += prod / a_i
    return prod / dev
    

if __name__ == "__main__":
    n = int(input().strip())
    a = list(map(int, input().strip().split(" ")))

    print(solve(n, a))

Submission status: Accepted

Solution code:
from fractions import Fraction


def main():

    N = int(input())
    a = list(map(int,input().split()))
    aList = []
    
    for i in a:
        tmp = Fraction(1,i)
        aList.append(tmp)

    pre = sum(aList)
    print(pre.denominator/pre.numerator)



if __name__== "__main__":
    main()

Submission status: Accepted

Solution code:
import functools
import operator

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

frac = functools.reduce(operator.mul, a)
deno = 0
for i in range(n):
  deno += frac/a[i]
print(frac/deno)

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()))
s = 0
for i in range(n):
    s += 1/float(a.pop())

print(1/s)

Submission status: Accepted

Solution code:
import decimal

# N
# p1 p2...pN
# -----------
n = int(input())
a = list(map(int, input().split()))

# a = np.array(a)
# print(a)
sum_reciprocal = 0

for i in range(len(a)):
    b = decimal.Decimal(1/a[i])
    sum_reciprocal += b

print(decimal.Decimal(1/sum_reciprocal))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
# ABC138B

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

print(1 / res)

Submission status: Accepted

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

print(1/count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(1 / ans)

Submission status: Accepted

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

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

print(1 / result)

Submission status: Accepted

Solution code:
from fractions import Fraction

n = int(input())
a = map(int, input().split())
ans = sum([Fraction(1, i) for i in a])

print(float(Fraction(1, ans)))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000)

def getN():
    return int(input())
def getList():
    return list(map(int, input().split()))
import math

n = getN()
nums = getList()

ans = 0
for num in nums:
    ans += 1/ num
    # print(ans)

print(1/ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce
import operator
 
n =int(input())
a = [int(x) for x in input().split()]
print(1/sum([1/x for x in a]))

Submission status: Accepted

Solution code:
import math 

N = int(input()) #数値
A =[int(i) for i in input().split()]

ans = 0
for i in range(int(N)):
  ans = float(ans) + float(1 / A[i])
  #print(ans)

print(float(1/ans))

Submission status: Accepted

Solution code:
from fractions import Fraction

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

for i in range(n):
  a_sum += Fraction(1,a[i])
  
print(float(Fraction(1,a_sum)))

Submission status: Accepted

Solution code:
n = int(input())
s = str(input())
a_s = s.split()
a_s = [float(str) for str in a_s]

ans = 0.0
idx = 0
while idx < n:
  ans += 1/a_s[idx]
  idx += 1

ans = 1/ans
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
 
def gcd_list(li):
	if len(li) > 2:
		x = gcd(li[-1], li[-2])
		li = li[:-2] + [x]
		return gcd_list(li)
	else:
		return gcd(li[0], li[1])


def main():
    a = int(input())
    lists = list(map(int, input().split()))
    score = []

    if len(lists)==1:
        print(lists[0])
        sys.exit()

    bai = gcd_list(lists)

    for i in lists :
        num = bai / i
        score.append(num)

    bunbo = sum(score)

    ans = bai /bunbo
    print(ans)


if __name__ == '__main__' :
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce

n = int(input())
a = [int(s) for s in input().split()]
s = reduce(lambda x, y: x * y, a)
d = sum(s / x for x in a)
print('%.6f' % (s / d))

Submission status: Accepted

Solution code:
from fractions import Fraction
def inverse(A):
    return 1/A
N = int(input())
A = list(int(i) for i in input().split())
ans = 0
for i in range(N):
    ans += inverse(A[i])
print(1/ans)

Submission status: Accepted

Solution code:
def reciprocal(a):
    return 1 / a

n = int(input())
a = list(map(int, input().split()))
sum = 0
for i in range(n):
    sum += reciprocal(a[i])

print(1 / sum)

Submission status: Accepted

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

sumGayku = 0
for a in A:
    sumGayku += 1.0/a

print(1/sumGayku)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
A = [int(a) for a in input().split()]

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

print(1/total)

Submission status: Accepted

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

for a in A:
  ans += 1 / a

ans = 1 / ans

print(ans)

Submission status: Accepted

Solution code:
def inpl(): return list(map(int, input().split()))

N = int(input())
print(1/sum([1/v for v in inpl()]))

Submission status: Accepted

Solution code:
N = int(input())

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

newList = []

for i in A:
    newList.append(1 / i)

count = sum(newList)

print(1 / count)

Submission status: Accepted

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

total = 0

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

print(1/total)

Submission status: Accepted

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

print(ave(num_list))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())

arr = list(map(float, input().split(" ")))

ans = 0.
for i in range(n):
    ans += np.reciprocal(arr[i])

print(1/ans)

Submission status: Accepted

Solution code:
while True:
    try:
        N = int(input())
        A = map(int, input().split())
        print(1/sum(map(lambda x: 1/x, A)))
    except EOFError:
        break

Submission status: Accepted

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

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

print(float(d/m))

Submission status: Accepted

Solution code:
#B
n = int(input())
a = list(map(int, input().split()))
#1/sum(1/a)
#1/a+1/b+1/c = (ab+bc+ca) / abc
#1/sum(1/A) = abc / (ab+bc+ca)
prod = 1
for i in range(n):
    prod *= a[i]
lst = []
la = lst.append
for i in range(n):
    la(prod/a[i])
ans = prod/sum(lst)
print(ans)

Submission status: Accepted

Solution code:
import numpy as np


def main():
    _ = int(input())
    A = list(map(int, input().split()))
    arr = np.array(A)
    a = 1 / arr
    s = sum(a)

    print(1 / s)

    return


if __name__ == "__main__":
    main()

Submission status: Accepted

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

for i in a:
    gyaku += 1/i

ans = 1/gyaku
print(ans)

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:
#!/usr/bin/env python

N = input()
N = int(N)

A = []
A = input().split()

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

print(1/sum)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
a_reverse = [0] * n
bunbo = 0
answer = 0

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

answer = 1 / bunbo
print(answer)

Submission status: Accepted

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

N = int(input())
A = list(map(lambda x: 1/int(x), input().split()))
A.sort()
sum = 0
for n in A:
    sum += n
#end for
print(1/sum)

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]
  
res = 1/sum

print(res)

Submission status: Accepted

Solution code:
import numpy as np
n =int(input())
a = list(map(float,input().split()))

b = sum(np.reciprocal(a))

print(np.reciprocal(b))

Submission status: Accepted

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

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:
a = int(input())

bb = input()
b = []
for i in bb.split(' '):
    b.append(int(i))

c = 1
for i in b:
    c = c * i

m = 0
for i in b:
    m = m + c / i

print(c / m)

Submission status: Accepted

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

denominator = int()

for i in A:
	denominator += 1/i

print(1/denominator)

Submission status: Accepted

Solution code:
result = 0
N = int(input())
array=[int(x) for x in input().split()]
# print(array)
for i in range(len(array)):
    # print("数値",array[i])
    # print("逆数",1/array[i])
    result += 1/array[i]
    # print(numpy.reciprocal(array[i]))

print(1/result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0.0
for a in alist:
    ans += 1 / a
ans = 1 / ans

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = list(map(int,input().split()))
c = 0

for i in b:
  c += 1 / i

print(1 / c)

Submission status: Accepted

Solution code:
from fractions import Fraction


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


N = int(input())
A = list(map(int, input().split()))
ans = []
reverse = []

for i in A:
    ans.append(Fraction(1, i))
    reverse.append(Fraction(i, 1))

print(float(inverse(sum(ans))))

Submission status: Accepted

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

mom_sum = sum(map(lambda x: 1/x,A))
print(1/mom_sum)

Submission status: Accepted

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

tmp = 0

for i in li:
  tmp += (1/i)

print(1/tmp)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(1/denominator)

Submission status: Accepted

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

top = 1
under = 0
for i in range(N):
    top = top * int(A[i])
    
for i in range(N):
    under = under + (top / int(A[i]))

result = top / under
print(result)

Submission status: Accepted

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

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

print(A1/sum)

Submission status: Accepted

Solution code:
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
#logging.disable(logging.CRITICAL)

def main():
    N = int(input())
    A_1 = list(map(int, input().split()))
    logging.info("Hello!")

    sum = 0
    for i in A_1:
        sum += (1 / i)


    print(1 / sum)
    
    
    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

ans = 0.0

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

ans = 1/sum(A)

print(ans)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import Fraction
N = int(input())
A = list(map(int, input().split(' ')))
sum = 0
tmp=0
for i in A:
    sum += Fraction(1,i)
print(float(Fraction(1,sum)))

Submission status: Accepted

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

Submission status: Accepted

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

nums_inv = [1 / x for x in nums]
print(1 / sum(nums_inv))

Submission status: Accepted

Solution code:
from fractions import Fraction
from sys import stdin

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

    n = 0
    for i in A:
        n += Fraction(1, i)
    print(n.denominator / n.numerator)

input = lambda: stdin.readline()
main()

Submission status: Accepted

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

sum = 0

for num in nums:
  sum += 1 / num

print(1 / sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
N = int(input())
a = list(map(int, input().split()))

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

print(Decimal(1/res))

Submission status: Accepted

Solution code:
import sys
a = []
for l in sys.stdin:
    a.append(l)

a_array = a[1].split(' ')
a_array

sum = 0

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

print(1 / sum)

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int, input().split()))
B=[0]*N

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

sumB=sum(B)
print(1/sumB)

Submission status: Accepted

Solution code:
n=input()
alist= [int(x) for x in input().split()]
prod=1
for a in alist:
    prod*=a
s=0
for a in alist:
    s+=prod//a
print(prod/s)

Submission status: Accepted

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

import fractions as frc
from functools import reduce

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

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

x=lcm_list(s)
tot=0

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

Submission status: Accepted

Solution code:
import functools
import operator

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

prod = functools.partial(functools.reduce, operator.mul)
p = prod(A)
p_list = sum(p // a for a in A)

print(p / p_list)

Submission status: Accepted

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

# 逆数のリストを作って合計を取り、1をその数で割った値が答え
reciprocal_total = sum([(1.0 / n) for n in nums])
ans = 1.0 / reciprocal_total
print(ans)

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    #　入力
    N = int(input())
    A = list(map(int, input().split()))
    bunbo = 0
    for i in range(N):
        bunbo += float(1/A[i])
    print(float(1/bunbo))

Submission status: Accepted

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