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:
from math import factorial as fact
import math
import sys
import itertools
import numpy as np
from collections import Counter
import datetime


#入力:N(int:整数)
def input1():
	return int(input())

#入力:N,M(int:整数)
def input2():
	return map(int,input().split())

#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))

def keta(N):
	return len(str(N))


def input_daytime(input_time):
	time,distance=input_time.split()
	t=time.split(":")
	se=str(t[-1]).split(".")
	dt1 = datetime.timedelta(hours=int(t[0]),minutes=int(t[1]),seconds=int(se[0]),milliseconds=int(se[1]))
	return dt1

def combinations(n,r):
	return list(itertools.combinations(range(n),r))



def all_sets(num_list):
	subsets=[]
	for i in range(2,len(num_list) + 1):
		for c in combinations(num_list, i):
			subsets.append(c) 
	return subsets

#公約数の列挙
def ch(x1):
	cf=[]
	for i in range(2,math.sqrt(x1)+1):
		if x1 % i==0:
			cf.append(i)
	return cf

def CountOneRoots(x,y):
	#x:縦，y:横
	return fact(x+y)/fact(x)/fact(y)

# 素因数分解
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
			


n=input1()
A=input_array()

print("{:.5f}".format(1/sum(1/x for x in A)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import numpy as np

ones = np.ones(N)

total = np.sum(ones/A)

print(1/total)

Submission status: Accepted

Solution code:
import sys, heapq

N = int(input())
A = list(map(int, sys.stdin.readline().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+=1/a[i]
print(1/sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    #a,b,c=map(int, readline().rstrip().split())
    #arr=list(map(int, readline().rstrip().split()))
    n=int(readline())
    arr=list(map(int, readline().rstrip().split()))
    x=0
    for a in arr:
        x+=1/a
    print(1/x)
    #ss=readline().rstrip()
    #yn(1)

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(1/k)

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 6)
#from collections import defaultdict
#d = defaultdict(int)
#import fractions
#import math
#import collections
#from collections import deque
#from bisect import bisect_left
#from bisect import insort_left
#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [input() for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
#import itertools
#import heapq
#import numpy as np
#INF = float("inf")
N = int(input())
A = list(map(int,input().split()))
s = 0
for i in A:
    s += i**(-1)
print(s**(-1))

Submission status: Accepted

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

Submission status: Accepted

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

sum = 0
for i in a_list:
    sum += 1/i

print(1/sum)

Submission status: Accepted

Solution code:
import numpy as np
import sys
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(1 / d)

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:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = LIST()
tmp = 0

for a in A:
	tmp += 1/a

print(1/tmp)

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 numpy as np
N = int(input())
A = [int(x) for x in input().split()]
count = 0
num = np.array(A)
print(1/sum(1/num))

Submission status: Accepted

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

ans = 0

for i in ai:
    ans += 1/i

print(1/ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:

import numpy as np
n=int(input())
a=list(map(float,input().split()))
a_array=np.array(a)
a_inv=np.reciprocal(a_array)
print(float(1/sum(a_inv)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

C=A**-1
#print(C)
print((C.sum())**-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
A=map(int,input().split())
B=[]
for i in A:
  B.append(i**(-1))
print(sum(B)**(-1))

Submission status: Accepted

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

def main():
    *N, = map(int, open(0).read().split())
    A = N[1:]
    N = N[0]

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


main()

Submission status: Accepted

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

souwa = sum([1/i for i in a])
print(1/souwa)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
h = int(input())


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

div_hoge = list(map(lambda x: 1/x,hoge))
ans = 1/sum(div_hoge)
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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()))
res = []
for a in A:
  res.append(1 / a)
print(1 / sum(res))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B - Resistors in Parallel

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

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

print(pow(ans, -1))

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:
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))
n = int(input())
a = list(map(int, input().split()))
ans = 0.0
for x in a:
    ans += 1.0 / x
print(1.0 / ans)

Submission status: Accepted

Solution code:
n = int(input())
s = input().split()
a = 0
c = 0
while a < n:
  c += 1/(int(s[a]))
  a += 1
print(1/c)

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:
def main():
	n = int(input())
	arr = list(map(int,input().split()))
	add = 0
	for x in arr:
		add+=(1/x)
	print(1/add)




main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

for i in range(N):
    ans += 1/H[i]

print(1/ans)

Submission status: Accepted

Solution code:
n = int(input())
def f(x):
    return 1 / x
List = list(map(int, input().split()))
List2 = [x for x in map(f, List)]
s = sum(List2)
print(1 / s)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(1/ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

print(1/mom)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
lst = []
s = input().rstrip().split(' ')
for j in range(n):
  lst.append(int(s[j]))
temp = 0
for i in range(n):
  temp += 1 / lst[i]
ans = 1 / temp
print(ans)

Submission status: Accepted

Solution code:
# 初期入力
N = int(input())
A = list(map(int, input().split()))

#
Numerator=1
for i in range(N):
    Numerator *=A[i]

Denominator =0
for i in range(N):
    Denominator +=Numerator/A[i]

ans =Numerator/Denominator
print(ans)

Submission status: Accepted

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

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

print(1/ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
from functools import reduce
from operator import mul

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

temp_mul = reduce(mul, a_list)

temp_add = 0
for a in a_list:
    temp_add += temp_mul // a

ans = temp_mul / temp_add
print(ans)

Submission status: Accepted

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

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

print(sumsum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# ABC 138: B – Resistors in Parallel
N = int(input())
A = [int(s) for s in input().split()]

denominator = 0

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

print(1 / denominator)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

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

ans = 1 / sum(1 / x for x in a)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

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

sm=0

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

print(1/sm)

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

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

print(1 / gyaku)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = LIST()
a = []

for i in range(N):
  a.append(1/A[i])

print(1/sum(a))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = [int(a) for a in input().split()]
    print(1.0/sum(map(lambda x : 1/x, A)))
main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions
total = 0
A = int(input())
listB = list(map(int,input().split()))
if 1 < A:
    B = listB[0] * listB[1] // fractions.gcd(listB[0],listB[1])
    for i in range(A-2):
        B = listB[i+2] * B // fractions.gcd(B,listB[i+2])
else:
    B = listB[0]
for i in listB:
    total += B // i
print(B / total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7


def main():
  N = int(readline())
  A = np.array(readline().split(), np.float128)
  B = 1 / A
  C = B.sum()
  print(1/C)
  
  
if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop
import numpy as np

INF = float('inf')
NIL = - 1

""" Input
S = input().rstrip()
N, A, B = map(int, input().split())
D = [int(input()) for _ in range(N)]
"""
N = int(input())
A = np.array(input().split(), dtype=np.float64)
print(1 / sum(1 / A))




# def main():


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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop
import numpy as np

INF = float('inf')
NIL = - 1

""" Input
S = input().rstrip()
N, A, B = map(int, input().split())
D = [int(input()) for _ in range(N)]
"""
N = int(input())
A = list(map(int, input().split()))

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




# def main():


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

Submission status: Accepted

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

for i in a:
    sum_a += i ** -1

print(sum_a ** -1)

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

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

sm = sum(A)

print(1/sm)

Submission status: Accepted

Solution code:
import math

def main():
    n = int(input())
    a_l = list(map(int, input().split()))
    frac = 0
    for a in a_l:
        frac += (1 / a)
    print(1/frac)
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
x=int(input())
s=0
line=list(map(int,input().split()))
for i in line:
    s=s+(1.00/i)
s=1.00/s
print(s)

Submission status: Accepted

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

k = 0

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

Submission status: Accepted

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

print(1/i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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

ans = 1 / ans

print(ans)

Submission status: Accepted

Solution code:
def gyaku(n):
  return 1 / n
N = int(input())
A = list(map(int,input().split()))
A2 = list(map(gyaku,A))
x = sum(A2)
print(str(1 / x))

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 = map(int, input().split())
print(1.0 / sum(1.0 / a for a in 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()))

den = 1
num = 0
for i in range(n):
    b = 1
    for j in range(1, n):
        b *= a[(i + j) % n]
    den *= a[i]
    num += b

print(den / num)

Submission status: Accepted

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

ret = 1
for a in A:
    ret *= a
ret2 = sum([ret // a for a in A])
print(ret / ret2)

Submission status: Accepted

Solution code:
import os, sys, re, math
from fractions import Fraction

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

s = sum([Fraction(1, a) for a in A])
s = Fraction(s.denominator, s.numerator)

print(float(s))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
N = int(input())
A = [int(s) for s in input().split()]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy
def Resistors(n , al):

    ans = 0
    count = 0

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

    return numpy.reciprocal(count)

def main():
    n = int(input())
    al = list(map(int , input().split()))
    print(Resistors(n , al))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import io

nim = int(input())
mike = list(map(int, input().split()))
    
zen = 0
for i in range(nim):
    zen += 1/mike[i]
    
print(1/zen)

Submission status: Accepted

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

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

ans = 1 / bunbo

print(ans)

Submission status: Accepted

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

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

"""

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