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:
# coding: utf-8

num = int(input())
total = 0
str = input().split()
table = list(str)
for i in range(num):
    total += 1 / int(table[i])

total = 1 / total
print(total)

Submission status: Accepted

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())
A = [int(a) for a in stdin.readline().rstrip().split()]

A = [float(a) for a in A]

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()))
x = sum([1/a[i] for i in range(n)])
print(1/x)

Submission status: Accepted

Solution code:
n=int(input())

a_list=[1/int(i) for i in input().split()]
ans=1/sum(a_list)

print(ans)

Submission status: Accepted

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

for i in lis:
  x = 1 / i
  total += x

print(1 / total)

Submission status: Accepted

Solution code:
import numpy as np
N,*A=map(int,open(0).read().split())
print(1/np.sum(1/np.array(A)))

Submission status: Accepted

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

    for i in a:
        ans += 1 / i

    print(1 / ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


print(1 / sum(a))

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def aaa(num):
    return 1/num

def main():
    n = int(input())
    a = Input()
    ans = 1 / sum(aaa(i) for i in a)
    print(ans)
main()

Submission status: Accepted

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

x = 0

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

print(1/x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
As = list(mapint())
print(1/sum([1/a for a in As]))

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:
# 問題：https://atcoder.jp/contests/abc138/tasks/abc138_b

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

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(float,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()))
deno = 1
nume = 0.0
         
for i in range(n):
         deno *= a[i]
for j in range(n):
         nume_frac = deno / a[j]
         nume = nume + nume_frac
         
print((deno / nume))

Submission status: Accepted

Solution code:
# ABC138
# B Resistors in Parallel
import math
n = int(input())
A = list(map(int, input().split()))
y = 0
for i in A:
    y += 1000/i
x = 1/y*1000
print(x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ll=[1/x for x in l]

print(1/sum(ll))

Submission status: Accepted

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

reversed = [1/i for i in num_list]
sum_under = 0
for j in reversed:
    sum_under += j

ans = 1/sum_under

print(ans)

Submission status: Accepted

Solution code:
N=int(input())

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

ans=0

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

print(1/ans)

Submission status: Accepted

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

amul=1
for i in range(n):
    amul *= A[i]
asum=0
for i in range(n):
    asum += amul//A[i]

ans = amul / asum
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

bunbo=0

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

print(1/bunbo)

Submission status: Accepted

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

denominator = 0

for a in A:
    denominator += 1/a

answer = 1/denominator

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(1/B)

Submission status: Accepted

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

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

m = 0
for i in range(N):
    m += mul // A[i]

print(mul / m)

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 bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
A = LI()
wa = 0
for i in range(N):
    wa += 1/A[i]
print(1/wa)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

K = A/B
print(K)

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:
import numpy as np
n = map(int,input().split())
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()))

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

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

ans = mulAll / num

print(ans)

Submission status: Accepted

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

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()))
a_suseki = 1
a_nukewa = 0

for i in range(n):
  a_suseki = a_suseki * a[i]

for i in range(n):
  a_nukewa = a_nukewa + (a_suseki/a[i])

print(a_suseki / a_nukewa)

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

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

import math
def lcm(x, y):
    return (x*y)//math.gcd(x, y)
if n >=2:
    ue = lcm(a[0], a[1])
    if n >= 3:
        for i in range(2, n):
            ue = lcm(ue, a[i])
else:
    ue = a[0]

shita = 0
if n >=2:
    for i in range(len(a)):
        shita += ue//a[i]
else:
    shita = n

ans = ue / shita
print(f"{ans:.6f}")

Submission status: Accepted

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

n=int(input())
a=list(map(int,input().split()))
for i in range(n):
    a[i]=gyaku(a[i])

x=sum(a)
print(gyaku(x))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,A = input(), 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()))

s = 0

for x in a:
    s += 1 / x

print(1/s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
a.sort()
count=1
ans=0
ans=a[len(a)-1]*count
count+=1
for i in a:
    if ans%i!=0:
        break
ans2=0
for i in a :
    ans2+=ans/i
    
print (ans/ans2)

Submission status: Accepted

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

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:
def solve():
    n = int(input())
    s = list(map(int, input().split()))
    res = 0
    for ss in s:
        res += 1 / ss
    print(1/res)


solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/abc138/tasks/abc138_b
N = int(input())
N_List = sum(map(lambda x:1/x ,list(map(int,input().split()))))
print(1/N_List)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))


n = int(input())

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

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

Submission status: Accepted

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

b = [1/a[i] for i in range(n)]

print(1/sum(b))

Submission status: Accepted

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

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

print(1/sum([1/a for a in l_a]))

Submission status: Accepted

Solution code:
from fractions import Fraction

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

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

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

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

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(1 / sum_bunbo)

Submission status: Accepted

Solution code:
import decimal

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

rev = [decimal.Decimal(float(1/i)) for i in A]
print(decimal.Decimal(1/sum(rev)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# abc138_b.py
# https://atcoder.jp/contests/abc138/tasks/abc138_b

# B - Resistors in Parallel /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 200点

# 問題文
# N個の整数の列 A1,…,ANが与えられます。
# これらの逆数の総和の逆数 1/((1/A1)+…+(1/AN))を求めてください。

# 制約
#     1≤N≤100
#     1≤Ai≤1000

# 入力
# 入力は以下の形式で標準入力から与えられる。
# N
# A1 A2 … AN

# 出力
# 11A1+…+1ANの値を表す小数 (または整数) を出力せよ。
# 出力は、ジャッジの出力との絶対誤差または相対誤差が 10−5以下のとき正解と判定される。

# 入力例 1
# 2
# 10 30

# 出力例 1
# 7.5

# 1/((1/10)+(1/30))=1/(4/30)=30/4=7.5です。
# なお、7.50001, 7.49999 などと出力しても正解と判定されます。

# 入力例 2
# 3
# 200 200 200

# 出力例 2
# 66.66666666666667

# 11200+1200+1200=13200=2003=66.6666...です。
# なお、6.66666e+1 などと出力しても正解と判定されます。

# 入力例 3
# 1
# 1000

# 出力例 3
# 1000

# 111000=1000です。
# なお、+1000.0 などと出力しても正解と判定されます。


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    # S = lines[0]
    N = int(lines[0])
    # X, A = list(map(int, lines[0].split()))
    values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(6):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(M):
    #     valueses.append(list(map(int, lines[i+1].split())))

    su = 0

    for n in range(N):
        su += 1/values[n]

    return [1/su]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['2', '10 30']
        lines_export = [7.5]
    if pattern == 2:
        lines_input = ['3', '200 200 200']
        lines_export = [66.66666666666667]
    if pattern == 3:
        lines_input = ['1', '1000']
        lines_export = [1000]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(2)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Accepted

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

for i in range(n):
    list.append(1/a[i])
    
print(1/ sum(list))

Submission status: Accepted

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

sum = 0

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

ans = 1 / sum

print(ans)

Submission status: Accepted

Solution code:
import numpy as np
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()))
sum=0
for i in range(n):
  sum+=1/a[i]
print(1/sum)

Submission status: Accepted

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

Submission status: Accepted

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

a_re = [1/x for x in a]
su_a = sum(a_re)
print(1/su_a)

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

resolve()

Submission status: Accepted

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

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


n=int(input())
B = 1/np.array(list(map(int,input().split())))

print(1/np.sum(B))

Submission status: Accepted

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

Submission status: Accepted

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

tmp = 0
ans = 0

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

ans = 1/tmp

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

ただの倍数 = 1
for i in set(a):
    ただの倍数 *= i
ans = ただの倍数 / sum(ただの倍数 // i for i in a)
print([ans, int(ans)][ans % 1 == 0])

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(input())
    A = list(map(int, input().split()))
    for i in range(N):
        A[i] = 1 / A[i]

    print(1/sum(A))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
N = int(input())
array = list(map(int,input().split()))

if not ( 1 <= N <= 100 ): sys.exit()
if (min(array) < 1) or (max(array) > 1000) : sys.exit()

sum = 0
for J in array:
    sum += 1/J

print(1/sum)

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()))
print(1/sum(1/a for a in A))

Submission status: Accepted

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

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

print(1/out)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

C = float(sum(B))

print(float(1 / C))

Submission status: Accepted

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

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

print(1 / sum(rev_a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
*l,=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()))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import collections
import itertools
import heapq

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

    prod = 1
    for a in A:
        prod *= a
    prod_div_a = [0] * N
    for i in range(N):
        prod_div_a[i] = prod // A[i]
    res = prod / sum(prod_div_a)
    print(res)
    

if __name__ == "__main__":
    main()

Submission status: Accepted

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

B=0

for A in An:
    B+=1/A

print(1/B)

Submission status: Accepted

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

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

print(1 / sum_inverse)

Submission status: Accepted

Solution code:
import sys
from io import StringIO
import unittest


def resolve():
    # s = input()
    n = int(input())
    a = list(map(int, input().split()))
    # l = [list(map(int, input().split())) for _ in range(n)]

    print(1 / sum([1/aa for aa in a]))


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """2
10 30"""
        output = """7.5"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """3
200 200 200"""
        output = """66.66666666666667"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """1
1000"""
        output = """1000"""
        self.assertIO(input, output)


if __name__ == "__main__":
    # unittest.main()
    resolve()

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()))
print(1 / sum(list(1 / x for x 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]
print(1/sum_)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce
from operator import add, mul

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

numer = reduce(mul, A)
denom = reduce(add, [(numer // A[i]) for i in range(N)])

print(numer / denom)

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

print(1 / sum([1 / a_i for a_i in a]))

Submission status: Accepted

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

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

b = []
for i in a:
    b.append(p//i)
print(p/sum(b))

Submission status: Accepted

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

ys = map(lambda x: 1. / x, xs)
print(1. / sum(list(ys)))