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

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

ans = 0
for i in A:
    ans = ans + inverse(i)

print(float(inverse(ans)))

Submission status: Accepted

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

s=1
for i in a:
  s*=i
ans=s/sum(s/i for i in a)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
print(1.0 / sum(1.0 / float(x) for x in input().split()))

Submission status: Accepted

Solution code:
n = int(input())
a = tuple(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:
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 actual(n, A):
    return 1 / sum([(1 / x) for x in A])

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

print(actual(n, A))

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

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

Submission status: Accepted

Solution code:
N = int(input())
As = list(map(int, input().split()))
As_gyaku = [1 / i for i in As]
As_gyaku_sum = sum(As_gyaku)
print(1 / As_gyaku_sum)

Submission status: Accepted

Solution code:
N = int(input())
As = list(map(int, input().split()))
bunbo = 1
for i in As:
    bunbo *= i
bunshi_list = []
for i in As:
    bunshi_list.append(bunbo // i)
print(bunbo / sum(bunshi_list))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():
    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)


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
def main():
    n = int(input())
    a = map(int, input().split())
    x = []
    for i in a:
        x.append(1/i)
    print(1/sum(x))
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys


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

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

Submission status: Accepted

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

for j in range(N):
    ans+=a[j]

print(1/ans)

Submission status: Accepted

Solution code:
n = int(raw_input())
ais = map(int, raw_input().split(' '))
cumul = [0,1]
"""
a    b
15 = 6 x 2 + 3
b    a%b

a    b       a%b
6  = 3 x 1 + 0
b    a%b

a   b
3   0

"""
def gcd(a,b):
	return gcd(b, a % b) if b else a
	#return a if a else gcd(b, a % b)
for a in ais:
	b,c = cumul
	#1c   ab
	#ac   ac

	cumul = [c + a*b, a*c]
	g = gcd(cumul[0], cumul[1])
	cumul = [cumul[0]/g, cumul[1]/g ]

print float(cumul[1])/cumul[0]

Submission status: Accepted

Solution code:
def resolve():
    N = int(input())
    all = list(map(int, input().split()))
    ans = 0
    for i in all:
        mom = 1/i
        ans += mom
    dad = 1/ans
    print(dad)
resolve()

Submission status: Accepted

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

Submission status: Accepted

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

A_inv = [1]*N

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

total = 0
for i in lis:
    total += 1/i
    
print(1/total)

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:
def li():
    return list(map(int, input().split()))
def mi():
    return map(int, input().split())
def ii():
    return int(input())
def lim(N):
    return [int(input()) for i in range(N)]

N = ii()
A = li()

bunbo = 0

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

print(1 / bunbo)

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit


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

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

    den = sum([num // a[i] for i in range(n)])

    print(num / den)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)

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

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

Submission status: Accepted

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

import numpy as np

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

ans = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Python3 (3.4.3)
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
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 = [int(x) for x in input().split()]

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

print(1/all_b)

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 = input()
n_int = int(n)
a = input().split()
y = 0

for i in range(n_int):
  x = int(a[i])
  y += 1/x

print(1/y)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(100000)

def solve(x,a,ans=0):
  if x == 0:
    return ans
  else:
    return solve(x-1,a[1:],ans+1/a[0])
  
N = int(input())
a = list(map(int,input().split()))

print(1/solve(N,a))

Submission status: Accepted

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

Submission status: Accepted

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


def inverse(num):
    return 1/num


invAlist = []

for a in Alist:
    invAlist.append(inverse(a))


print(inverse(sum(invAlist)))

Submission status: Accepted

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

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def main():
    N = int(readline())
    As = map(int, readline().split())
    ans = 0
    for a in As:
        ans += 1 / a
    print(1/ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

b= list(map(lambda x:1/x, a))

print(1/sum(b))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    n = input()
    t = list(map(int, input().split()))
    t = [1/v for v in t]
    ans = 1/sum(t)
    print(ans)

if __name__ == '__main__':
    main()

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 = tuple(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=[int(x) for x in 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()))
sum1 = 0
for i in range(0,N,1):
    sum1 += 1/A[i]
print(1/sum1)

Submission status: Accepted

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

for i in a:
    j = 1 / i
    rev_a.append(j)
b=0
for k in rev_a:
    b += k

print(1/b)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(1/b)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(1/sum_tmp)

Submission status: Accepted

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

Submission status: Accepted

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

print(
    1 / sum(1/A for A in array)
)

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
import sys
from fractions import gcd
N=int(sys.stdin.readline().strip())
A=map(int, sys.stdin.readline().split())
for i,a in enumerate(A):
    if i==0:
        a_gcd=a
    else:
        a_gcd=gcd(a_gcd,a)

a_lcm=a_gcd
for a in A:
    a_lcm*=a/a_gcd

bunbo=0
for a in A:
    bunbo+=a_lcm/a

print float(a_lcm)/bunbo

Submission status: Accepted

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

ans = 0
for Ai in A:
  ans += 1/Ai

print(1/ans)

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())

A = np.array(input().split(), dtype=np.float64)
ans = 1 / (1/A).sum()

print(ans)

Submission status: Accepted

Solution code:
import numpy as np

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

A = np.array(A)
B = 1 / A
C = B.sum()
print(1/C)

Submission status: Accepted

Solution code:
import fractions
from functools import reduce

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

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

n = int(input())
a = list(map(int,input().split()))
lcm = lcm_list(a)
d = [0]*n

for i in range(n):
    d[i] = lcm//a[i]

print(lcm/sum(d))

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

Submission status: Accepted

Solution code:
n = int(input())

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

value = 0

for i in l:
    value = value+1/i

print(1/value)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)

def main():
    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)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

bunbo = 0
for i in range(len(arr)):
    bunbo += 1/arr[i]

print(1/bunbo)

Submission status: Accepted

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

a = 1
for i in A:
    a *= i
b = 0
for j in A:
    b += a / j

print(a/b)

Submission status: Accepted

Solution code:
n=int(input())
r=0
a=[0]*n

def lambda_a(s):
  return 1/int(s)

a[:]=map(lambda_a,input().split())
for ii in range(n):
  r+=a[ii]
print(1/r)

Submission status: Accepted

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

ans=0
i=0
while i<N:
    
    ans+=(1/List[i])
    
    i+=1

print(1/ans)

Submission status: Accepted

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

print(1/sum([1/i for i in V]))

Submission status: Accepted

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

print(sum([i**(-1) for i in V])**(-1))

Submission status: Accepted

Solution code:
# input
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 = [int(N) for N in input().split()]
temp = 0

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

Submission status: Accepted

Solution code:
n = int(input().rstrip())
a = [int(i) for i in input().rstrip().split()]
v = 0.0
for i in range(len(a)):
	v = v + 1 / a[i]

print(1 / v)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Fri May 15 00:22:18 2020

@author: Kanaru Sato
"""

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

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

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

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

def main():
    N = int(readline())
    A = [int(i) for i in readline().split()]

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

a = 1 / a
  
print(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:
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()))
count = a[0]
num = 1

for i in range(1, len(a)):
    num = num * a[i] + count
    count *= a[i]

print(count/num)

Submission status: Accepted

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

tmp = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#############
# Main Code #
#############

N = input()
A = inputIL()

print(1/sum(1/x for x in A))

Submission status: Accepted

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

mother = 0

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

print(1 / mother)

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

ans = 1/sum([1/A for A in As])
print(ans)

Submission status: Accepted

Solution code:
# ABC138B

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

Submission status: Accepted

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

print(1/SUM)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


print(1/sum(A))

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
#N,K = map(int,input().split())
#N = int(input())
V = list(map(int,input().split()))

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

Submission status: Accepted

Solution code:
from fractions import Fraction
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()))
ans=0
for i in A:
    ans+=1/i
print(1/ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
#from fractions import gcd
#from math import gcd
import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


n = I()
A = LI()

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

print(1/tmp)

Submission status: Accepted

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

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

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

t = 0

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

Submission status: Accepted

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

tmp = 1
for a in A:
    tmp *= a

ans = 0
for a in A:
    ans += tmp//a

print(tmp/ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
L=list(map(int,input().split()))
m=[]
for i in L:
  a=1/i
  m.append(a)
S=sum(m)
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 = [int(x) for x in input().split()]
print(1 / sum([1 / a for a in a_list]))

Submission status: Accepted

Solution code:
# B - Resistors in Parallel

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

Submission status: Accepted

Solution code:
_,*a=map(int,open(0).read().split());print(1/sum(1/x for x in a))