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()))
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=[]
for i in range(n):
  ans.append(1/l[i])
print(1/sum(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print('{:.16g}'.format(1 / sum(1 / x for x in A)))

Submission status: Accepted

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

Submission status: Accepted

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

prod = 1
for ii in range(N):
    prod *= A[ii]
sum = 0
for ii in range(N):
    sum += prod//A[ii]
print(float(prod)/float(sum))

Submission status: Accepted

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

print(1/buf)

Submission status: Accepted

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

prod = 1
for a in A:
  prod = prod * a
  
divs = 0
for a in A:
  divs += prod // a
  
print(prod / divs)

Submission status: Accepted

Solution code:
n = int(input())

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

count=0

for i in range(n):
    count += (1/li[i])

print(1/count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def rec(x):
  return 1/x

n=int(input())
a_list=list(map(int,input().split(" ")))
a_recsum = sum(map(rec,a_list))
print(rec(a_recsum))

Submission status: Accepted

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

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:
# ABC 138: B – Resistors in Parallel
n = int(input())
a = [int(s) for s in input().split()]

denominater = 0

for b in a:
    denominater += 1 / b

print(1 / denominater)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import Fraction
N = int(input())
A =list(map(int,input().split()))
A_list = []
for x in A:
    A_list.append(Fraction(1,x))
sum = Fraction(0)
for x in A_list:
    sum += x
result = 1/sum
result_f = float(result)
print(result_f)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

import sys

input = sys.stdin.readline

# input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(1/lower)

Submission status: Accepted

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

#print(ai)

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

print(1/ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# 2019-11-17 10:52:21(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
from functools import reduce
# import operator as op
# import re
# import heapq
# import array
# from scipy.misc import comb # (default: exact=False)
# import numpy as np

def sum_inverses(a, b):
    return a + 1 / b

def main():
    n, *a = map(int, sys.stdin.read().split())

    ans = 1 / reduce(sum_inverses, a, 0)
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())

a = list(map(int, input().split()))
sum = sum([1.0/i for i in a])

print("{}".format(1.0/sum))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
S = 0
for i in range(0,len(A)):
    S += 1/A[i]
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 += 1/A[i]


ans = 1/sum

print(ans)

Submission status: Accepted

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


def gcd(a, b):
    # greatest common divisor
    while b > 0:
        a, b = b, a % b

    return a


def lcm(a, b):
    # least common multiple
    return a * b // gcd(a, b)


N = int(input())
A = inpl()

c = A[0]
for a in A[1:]:
    c = lcm(c, a)

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

Submission status: Accepted

Solution code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
import numpy as np
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

n = inp()
Alist = np.array(inpl())
print(1.0/((1.0/Alist).sum()))

Submission status: Accepted

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

B = 0

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

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import fractions
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


# 初項s, 交差dのn個の数列の和
def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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

    ans = 0
    for i in range(N):
        ans += fractions.Fraction(1, A[i])

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


if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


def solve():
    ans_tmp = 0
    for aa in a:
        ans_tmp = ans_tmp + 1 / aa

    return 1 / ans_tmp


print(solve())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

d = float(0)

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

print(1/d)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
numbers = list(map(int,input().split()))
rev_sum=0
ans = 0
for number in numbers:
    rev_sum += 1/number
ans = 1/rev_sum
print(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:
n = int(input())
a = list(map(int, input().split()))

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

print(1/wa)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

res = 1 / sum([1 / a for a in a_s])
print(res)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
for i in A:
    ans += 1/i
    ans = round(ans,10)

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

Submission status: Accepted

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

B_list = []
for i in range(N):
    B_list.append(1/A_list[i])

print(1/sum(B_list))

Submission status: Accepted

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

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

print(1 / sum)

Submission status: Accepted

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

Submission status: Accepted

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

print(1 / denom)

Submission status: Accepted

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

sumbunnsi = 0
i= 0
while i <= n-1:
      sumbunnsi= sumbunnsi + (1/A[i])
      i += 1

print(1/sumbunnsi)

Submission status: Accepted

Solution code:
N=int(input())
l=list(map(int,input().split()))
tmpl=[]
for num in l:
  tmpl.append(1/num)
tmp=0
for num in tmpl:
    tmp+=num
print(1/tmp)

Submission status: Accepted

Solution code:
N = int( input() )
A_list = list( map( int, input().split() ) )
s = float()
for i in A_list:
    s += float(1/i)
print( float( 1/s ) )

Submission status: Accepted

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

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 / sum)

Submission status: Accepted

Solution code:
N = 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()))
cal = []
for i in range(N):
    cal.append(1 / A[i])
cal = 1 / sum(cal)
print(cal)

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 numpy as np

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

#print(N)
#print(A)

inv_A = [1/A[i] for i in range(len(A))]
sum_inv_A = np.sum(inv_A)
print(1/sum_inv_A)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
Sum = 0
for a in A:
    Sum = Sum + 1/a
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]
print(1/sum)

Submission status: Accepted

Solution code:
import math

N=int(input())
A=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき

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

print(1/cnt)

Submission status: Accepted

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

def main():
    N = int(input())
    As =  [int(s) for s in input().split()]
    bunbo = 0
    for A in As:
        bunbo += 1/A
    print(1/bunbo)
        


if __name__ == "__main__":
    main()

Submission status: Accepted

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

tmp=0
for ai in a:
    tmp+=1/ai
print(1/tmp)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

  
while n>i:
  k+=1/an[i]
  i+=1
  
print(1/k)

Submission status: Accepted

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

sumA = 0

for a in an:
    sumA += 1/a
print(1/sumA)

Submission status: Accepted

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

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:
from fractions import Fraction

N = int(input())
A = list(map(int,input().split()))
a = []
b = 0

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

for i in a:
  b += i
print(float(1 / b))

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1 / ans
print(ans)

Submission status: Accepted

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

mother = 0

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

print(1/mother)

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

def main():
    # input
    n = int(input())
    temp = 0
    for i in map(int, input().split()):
        temp += 1/i


    # calc
    print(1/temp)


if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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())
str = input()
ls = [int(u) for u in str.split()]
num = 1
denom = 0
#print(ls)
for value in ls:
    denom += (1/value)
print(1/denom)

Submission status: Accepted

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

div = 0
for a in a_list:
    div += 1/a
print(1/div)

Submission status: Accepted

Solution code:
n = int(input())
m = 0
for i in input().split():
    m += 1 / int(i)
m = 1 / m
if m == int(m):
    print(int(m))
else:
    print(m)

Submission status: Accepted

Solution code:
x = int(input())
y = [int(i) for i in input().split()]

tmp = []

for i in y:
  tmp.append(1/i)
  
print(1/sum(tmp))

Submission status: Accepted

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

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

Submission status: Accepted

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

res = 0

for a in A:
    res += 1/a

print(1/res)

Submission status: Accepted

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

s=0
p = 1 
for i in v :    
    p *= i

num = p

for i in v :
    s += p / i

den = s
num = float ( num )
den = float ( den )

ans=num/den

print ans

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import Fraction
def inverse(f):
  return Fraction(f.denominator, f.numerator)

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

r = 0
s = 0
while s < n:
  r += Fraction(1, a[s])
  s += 1

print(inverse(r).numerator/inverse(r).denominator)

Submission status: Accepted

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

Submission status: Accepted

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

sn = 0

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

Submission status: Accepted

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

preans=0

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

print(1/preans)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n):
  s.append(1/d[i])
print(1/sum(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('{:.6f}'.format(1/s))

Submission status: Accepted

Solution code:
import numpy as np
n = int(input())
li = list(map(int,input().split()))
li_in = []
for i in li:
    li_in.append(1/i)
print(1/sum(li_in))

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


sum_bunsi = 0


for A in A_list:
        sum_bunsi += 1/A

print(1/sum_bunsi)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 19,Oct,2019
"""

import sys
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline())
lis = list(map(int, readline().split()))

mot = 0
for i in lis:
    mot += 1 / i

print(1/mot)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = []
S = 0
for i in range(N):
    B.append(1 / A[i])
S = sum(B)
print(str(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())
A = list(map(int,input().split()))

sum = 0

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

ans = 1 / sum

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(1/ans)

Submission status: Accepted

Solution code:
n=int(input())
a=[int(x) for x in input().split()]
c=0
for i in range(n):
  c+=a[i]**(-1)
print(c**(-1))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

ans = 1 / sum
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

A_gyaku = []
for a in A:
    A_gyaku.append( round(1/a, 7) )

print(1/sum(A_gyaku))

Submission status: Accepted

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

reverse = 0

for i in A:
    reverse += 1/i

print(1/reverse)

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 math

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

    t = 0

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N = int(readline())
A = np.array(read().split(),np.int64)

x=1/(1/A).sum()
print(x)

Submission status: Accepted

Solution code:
from fractions import Fraction

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

sum = 0

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

print(float(1/sum))

Submission status: Accepted

Solution code:
a = [input().split() for l in range(2)]
N=int(a[0][0])
bunbo=0
for i in range(N):
    #AN=int(A[1][N])
    bunbo=bunbo+1/int(a[1][i])

print(1/bunbo)

Submission status: Accepted

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

res = 0

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

Submission status: Accepted

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

res = 0;
for i in l:
	res+=1/i
print(1/res)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(1/sum(b))

Submission status: Accepted

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

s =1/sum([1/i for i in Ai])
print(s)

Submission status: Accepted

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

ainv_sum=0
for a in alist:
  ainv_sum+=1.0/a
  
print(1.0/ainv_sum)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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:
ii = lambda : int(input())
mi = lambda : map(int, input().split())
li = lambda : list(map(int, input().split()))

import numpy as np

n = ii()
a = li()

x = np.array(a)
x = 1/x

print(1/np.sum(x))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
if __name__ == '__main__':
    n = int(input())
    Arrnums = [float(x) for x in input().split(' ')]
    q = 0
    for i in range(n):
        q =q +  1/Arrnums[i]
    print(1/q)

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

Submission status: Accepted

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

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)