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: Runtime Error

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

prod = 1
for i in range(n):
	ele = int(input())
	prod *= ele
	arr[i] = ele

numerator = prod

denomenator = sum(prod//ele for ele in arr)

ans = numerator/denomenator
print(ans)

Submission status: Runtime Error

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

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

b=s/a

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=input()
a=list(input())
result = 0
for num in a:
    result += 1/int(num)
    
print(1/result)

Submission status: Runtime Error

Solution code:
n=input()
a=list(input())
result = 0
for num in a:
    result += 1/num
    
print(1/result)

Submission status: Runtime Error

Solution code:
from fractions import Fraction as fa

n = int(input())
arr= [int(x) for x in input().split()]
ans = 0
for i in arr:
  ans += fa(1,i)
  
ans = str(ans).split('/')

print('%0.2f'%(int(ans[1])/int(ans[0])))

Submission status: Runtime Error

Solution code:
from fractions import Fraction as fa

n = int(input())
arr= [int(x) for x in input().split()]
ans = 0
for i in arr:
  ans += fa(1,i)
  
ans = str(ans).split('/')

print(int(ans[1])/int(ans[0]))

Submission status: Runtime Error

Solution code:
from fractions import Fraction as fa

n = int(input())
arr= [int(x) for x in input().split()]
ans = 0
for i in arr:
  ans += fa(1,i)
  
ans = str(ans).split('/')

print(ans[1]/ans[0])

Submission status: Runtime Error

Solution code:
from fractions import Fractions as fa

n = int(input())
arr= [int(x) for x in input().split()]
ans = 0
for i in arr:
  ans += fa(1,i)
  
ans = str(ans).split('/')

print(ans[1]/ans[0])

Submission status: Runtime Error

Solution code:
n=int(input())
a=[]
c=0
for i in range(n):
    b=int(input())
    c+=1.0/b
print(1.0/c)

Submission status: Runtime Error

Solution code:
n=int(input())
a=[]
c=0
for i in range(n):
    b=int(input())
    c+=1.0/b
print(1.0/c)

Submission status: Runtime Error

Solution code:
n=int(input())
A=sorted(map(int,input().split()))
ans=A[0]
for i in range(1,n):
  ans=(ans+A[i])/2
print(ans^(-1))

Submission status: Runtime Error

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

rev = []
for a in A:
    rev.append(1/float(a))

print(1/float(sum(rev)))

Submission status: Runtime Error

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

rev = []
for a in A:
    rev.append(1/float(a))

print(1/sum(rev))

Submission status: Runtime Error

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

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

print(1 / b)

Submission status: Runtime Error

Solution code:
n = int(input())
numbers = []
i = 0
while i <= n:
  numbers.append(int(input()))
  i += 1

j = 0
s = 0
while n >= j:
  s += 1/numbers[j]
  j += 1

print(1/s)

Submission status: Runtime Error

Solution code:
n = int(input())
numbers = []
for number in numbers:
  numbers.append(int(input))

i = 0
s = 0
while i >= n:
  s += 1/numbers[i]
  i += 1

print(1/s)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))
i = 0
for i <= N-1:
  B[i] = 1/A[i]
S = sum(B)
answer = 1 / S
print(answer)

Submission status: Runtime Error

Solution code:
n=int(input())
a=[]
for i in range(n):
  p=float(input())
  p=1/p
  a=a+[p]
 
x=sum(a)
print(1/x)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

N = int(input())
#s = input()
#S = []
#for i in range(N):
S = input().split(" ")
SUM = 0
for i in range(N):
    temp = S[i]
    temtem = 1 / temp
    SUM += temtem
Ans = 1 / SUM
print(Ans)

Submission status: Runtime Error

Solution code:
#from functools import reduce

N = int(input())
As = map(int,input().split())

P = reduce(lambda a,b:a*b,As)

print(P/sum([P/a for a in As]))

Submission status: Runtime Error

Solution code:
from functools import reduce

N = int(input())
As = map(int,input().split())

P = reduce(lambda a,b:a*b,As)

print(P/sum([P/a for a in As]))

Submission status: Runtime Error

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

def main():
    n = int(input())
    num = makeNumList(input())
    ans = 0.0
    
    for i in range(n):
        ans += invNum(num[i])
    
    print(invNum(ans))

def invNum(n):
    return 1 / n

def makeNumList(raw):
    num = []
    raw = raw.split(" ")
    for i in range(len(raw)):
        num.append(raw[i])
    return num

main()

Submission status: Runtime Error

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

print(1/sum)

Submission status: Runtime Error

Solution code:
import numpy as np

def main():
    inputs = [input() for _ in range(2)]
    numbers = np.array([float(i) for i in inputs[1].split('\s')])
    numbers = np.reciprocal(numbers)
    answer = 1 / sum(numbers)
    print(answer)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N = int(input())

sum_a = 0
for _ in range(N):
	a = int(input())
    sum_a += 1/a

print(1/sum_a)

Submission status: Runtime Error

Solution code:
n = int(input())
a = input().split(' ')
for i in range(n):
  a[i] = int(a[i])
print(a)

def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a

bunshi = 1
bunbo = a[0]
for i in range(1, n):
  bunshi = bunbo + a[i]
  bunbo = bunbo * a[i]
  gcd = gcd(bunbo, bunshi)
  bunbo = bunbo / gcd
  bunshi = bunshi / gcd
print(bunbo / bunshi)

Submission status: Runtime Error

Solution code:
N = int(input())
A = map(int,input())
x =0
for a in A:
  x+=1/A
print("{:,5f}".format(1/x))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

d=1
m=0
for i in range(n):
  d *= i
  m += i

ans = d/m
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
A = [int(x) for x in input().split()]
for i in range(N):
  sam += A[i]**-2
print(sam**-2)

Submission status: Runtime Error

Solution code:
a = int(input())
sam = 0
b = 0
for i in range(5):
  b = int(input())
  sam += b**-2
print(sam**-2)

Submission status: Runtime Error

Solution code:
a = int(input())
sam = 0
b = 0
for i in range(a):
  b = int(input())
  sam += pow(b, -1)
print(pow(sam, -1)

Submission status: Runtime Error

Solution code:
a = int(input())
sum = 0
for i in range(a):
  b = int(input())
  sum += pow(b, -1)
print(pow(sum, -1)

Submission status: Runtime Error

Solution code:
import numpy as np
a = int(input())
sum = 0
for i in range(a):
  b = int(input())
  sum += b
np.reciprocal(sum)
np.reciprocal(sum)
print(sum)

Submission status: Runtime Error

Solution code:
import numpy as np
a = int(input())
sum = 0
for i in range(a):
  bb = int(input())
  sum += b
np.reciprocal(sum)
np.reciprocal(sum)
print(sum)

Submission status: Runtime Error

Solution code:
a = int(input())
b = []
sum = 0
for i in range(a):
  b[i] = int(input())
  sum += b[i]
print(sum)

Submission status: Runtime Error

Solution code:
import numpy as np
a = int(input())
b = []
sum = 0
for i in range(a):
  b[i] = int(input())
  sum += b[i]
np.reciprocal(sum)
np.reciprocal(sum)
print(sum)

Submission status: Runtime Error

Solution code:
import numpy as np
a = int(input())
b = []
sum = 0
for i in range(a):
  b[i] = int(input())
  sum += b[i]
print(np.reciprocal(np.reciprocal(sum)))

Submission status: Runtime Error

Solution code:
import numpy as np
a = int(input())
b = []
sum = 0
for i in a:
  b[i] = int(input())
  sum += b[i]
print(np.reciprocal(np.reciprocal(sum)))

Submission status: Runtime Error

Solution code:
a = int(input())
b = []
sum = 0
for i in a:
  b[i] = int(input())
  sum += b[i]
print(reciprocal(reciprocal(sum)))

Submission status: Runtime Error

Solution code:
a = input()
b = []
sum = 0
for i in a:
  b[i] = input()
  sum += b[i]
print(reciprocal(reciprocal(sum)))

Submission status: Runtime Error

Solution code:
n = int(input())

lst = []

for i in range(n):
    lst.append(int(input()))

sum = 0
for el in lst:
    sum += 1/el

print(1/sum)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
a=list(map(1/int(),input().split()))

print(1/sum(a))

Submission status: Runtime Error

Solution code:
n=int(input())
i=1 
a=[0]
A=[0]

while i<=n:
    a.append(int(input()))
    A.append(1/a[i])
    A[0]+=A[i]
    i+=1

print(1/A[0])

Submission status: Runtime Error

Solution code:
'''
2
10 30
'''
lens = int(input())
arrs = [1/int(x) for x in input().split()]
print(1/arrs)

Submission status: Runtime Error

Solution code:
n = int(input())

sum_a_rev = 0

for i in range(n):
    val = int(input())
    sum_a_rev = sum_a_rev + 1/val

res = 1/sum_a_rev

print("{}".format(res))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from fractions import Fraction
n = int(raw_input())
val = []
for i in range(n):
  val.append(raw_input())
val = map(lambda x:Fraction(1,int(x)),val)
val = sum(val)
val = 1/val
val = float(val)
print val

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# Fraction クラスを呼びだします
from fractions import Fraction
n=int(input())
m=input().split()
tmp =0

for x in range(0,n):
  a = Fraction(1, int(m[x]))
  tmp+=a
  
print(Fraction(1, z))

Submission status: Runtime Error

Solution code:
n = int(input())
sum = 0
for A in range(n):
    num = int(input())
    sum += 1/num
ans = 1/sum
#print(ans)
print('{:.4g}'.format(ans))

Submission status: Runtime Error

Solution code:
n = int(input())

sum = 0
for A in range(n):
    num = int(input())
    sum += 1/num
ans = 1/sum
print('{:.7g}'.format(ans))

Submission status: Runtime Error

Solution code:
n = int(input())
a = [int(input()) for i in range(n)]
cnt = 0
for k in range(n):
    cnt += 1/a[k]
print(1/cnt)

Submission status: Runtime Error

Solution code:
n = int(input())

sum = 0
for A in range(n):
    num = int(input())
    sum += 1/num
ans = 1/sum

print('{:.7g}'.format(ans))

Submission status: Runtime Error

Solution code:
n = int(input())

sum = 0
for A in range(n):
    num = int(input())
    sum += 1/num
ans = 1/sum
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
for i in range(n):
    a.append(input())

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

Submission status: Runtime Error

Solution code:
a = int(input())
List=[int(i) for i in input().split()]
List.sort()
print(List)
num = 0
ans = []
while num < a:
  res = (List[num] + List[num+1])/2
  ans.append(res)
  resa = (ans[num] + List[num+2])/2
  num = num + 1
  if num == a:
  print(resa)
  break

Submission status: Runtime Error

Solution code:
N=int(input())
s=0
for i in range(0,N+1):
  a=int(input())
  s+=1/a
print(1/s)

Submission status: Runtime Error

Solution code:
n = int(input())

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

Submission status: Runtime Error

Solution code:
N=int(input())
s=0
for i in range(0,N):
  a=int(input())
  s+=1/a
print(1/s)

Submission status: Runtime Error

Solution code:
n = int(input())

a = input().split()
print(1/sum(a.map(lambda x:1/x)))

Submission status: Runtime Error

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

for i in range(n-1):
    b *= a[i]
for j in range(n-1):
    c.append(b/a[j])
print(b/sum(c))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
from functools import reduce


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

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


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

s = lcm_list(a)
z = list(map(lambda x: s /x , a))
print(s/sum(z))

Submission status: Runtime Error

Solution code:
N = int(input())
sum = 0.0
for _ in range(N):
    sum += 1 / int(input())
    print(sum)

sum = 1 / sum

print(sum)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import math

def get_lcm(x, y):
    return  math.gcd(x, y)
    return (x * y) // math.gcd(x, y)

def get_num(a, lcm):
    return lcm // a


N_str = input()
a_str = input()
a_str_list = a_str.split(" ")
a_list = list(map(lambda x: int(x), a_str_list))
lcm = 1
for a in a_list:
    lcm = get_lcm(lcm, a)

sum_a = 0
for a in a_list:
    sum_a += get_num(a, lcm)

result = lcm / sum_a
print(result)

Submission status: Runtime Error

Solution code:
import math
from functools import reduce


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

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

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

s = lcm_list(a)
z = list(map(lambda x: s /x , a))
print(s/sum(z))

Submission status: Runtime Error

Solution code:
import math

def get_lcm(x, y):
    return (x * y) // math.gcd(x, y)

def get_num(a, lcm):
    return lcm // a


N_str = input()
a_str = input()
a_str_list = a_str.split(" ")
a_list = list(map(lambda x: int(x), a_str_list))
lcm = 1
for a in a_list:
    lcm = get_lcm(lcm, a)

Submission status: Runtime Error

Solution code:
import math

def get_lcm(x, y):
    return (x * y) // math.gcd(x, y)

def get_num(a, lcm):
    return lcm // a


N_str = input()
a_str = input()
a_str_list = a_str.split(" ")
# a_list = list(map(lambda x: int(x), a_str_list))
a_list = []
for a in a_str:
    a_list.append(int(a))
lcm = 1
for a in a_list:
    lcm = get_lcm(lcm, a)

sum_a = 0
for a in a_list:
    sum_a += get_num(a, lcm)

result = lcm / sum_a
print(result)

Submission status: Runtime Error

Solution code:
from fractions import Fraction
N=int(input())
l=[]
for i in range(N):
    k=int(input())
    x=Fraction(1, k)
    l.append(x)

p=sum(l)
y=float(1/p)
print(y)

Submission status: Runtime Error

Solution code:
denominator = 0
for a in range(map(int, input().split())):
  denominator += 1 / a

print(1 / denominator)

Submission status: Runtime Error

Solution code:
def inverse(f):
    return 1/f
n = input()
count = round(float(n))
nlist = []
for i in range(0,int(count)):
    nlist.append(inverse(float(input())))

sumresu = sum(nlist)
print(inverse(float(sumresu)))

Submission status: Runtime Error

Solution code:
n = int(input())
l =[]
inv =[]
s = 0
for i in range(n):
    l.append(int(input()))

for i in l:
    i_inv = 1/i
    s += i_inv
print(1/s)

Submission status: Runtime Error

Solution code:
import math

def get_lcm(x, y):
    return (x * y) // math.gcd(x, y)

def get_num(a, lcm):
    return lcm // a


N_str = input()
a_str = input()
a_str_list = a_str.split(" ")
a_list = list(map(lambda x: int(x), a_str_list))
lcm = 1
for a in a_list:
    lcm = get_lcm(lcm, a)

sum_a = 0
for a in a_list:
    sum_a += get_num(a, lcm)

result = lcm / sum_a
print(result)

Submission status: Runtime Error

Solution code:
N = int(input())
A = [ int(input()) for i in range(N)]
a = [ 1/i for i in A]
res = 1/(sum(a))
print(res)

Submission status: Runtime Error

Solution code:
a = 0
count = 0
while count < int(input())+1:
  b = int(input())
  a += 1/b
  count +=1
c = 1/a
print(c)

Submission status: Runtime Error

Solution code:
n = int(input())
aa = list(map(int, input().strip().sprit()))

g = 0

# for 文書きたくねぇ
for a in aa:
    g += 1 / a

print(1 / g)

Submission status: Runtime Error

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

print(1/sum(a))

Submission status: Runtime Error

Solution code:
a = 0
for i in range(1,int(input())+1):
  b = int(input())
  a += 1/b
a = 1/a

Submission status: Runtime Error

Solution code:
def inverse(f):
    return 1/f
n = input()
nlist = []
for i in range(0,int(n)):
    nlist.append(inverse(float(input())))

sumresu = sum(nlist)
print(inverse(float(sumresu)))

Submission status: Runtime Error

Solution code:
import math

def get_lcm(x, y):
    return (x * y) // math.gcd(x, y)

def get_num(a, lcm):
    return lcm // a


N_str = input()
a_str = input()
a_str_list = a_str.split(" ")
a_list = mapped_list = map(lambda x: int(x), a_str_list)
lcm = 1
for a in a_list:
    lcm = get_lcm(lcm, a)

sum_a = 0
for a in a_list:
    sum_a = a * get_num(a, lcm)

result = lcm // sum_a
input(result)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

print(1/sum_reverse)

Submission status: Runtime Error

Solution code:
a = 0
for i in range(1,int(input())+1):
  a += 1/int(input())
a = 1/a

Submission status: Runtime Error

Solution code:
n = int(input())
a = [0]*n
for i in range(n):
  a[i] = int(input())

def cal(a):
  return 1/a

aa = cal(a)
aa_sum = sum(aa)

print(cal(aa_sum))

Submission status: Runtime Error

Solution code:
import numpy as np
n = input()
nlist = []
for i in range(0,int(n)):
    nlist.append(np.reciprocal(float(input())))

sumresu = sum(nlist)
print(np.reciprocal(float(sumresu)))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = []
for i in range(n): 
    a.append( 1/int(input()))

print(1/sum(a))

Submission status: Runtime Error

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

g = 0

# for 文書きたくねぇ
for x in a:
    g += 1 / x

print(1 / g)

Submission status: Runtime Error

Solution code:
import math
from functools import reduce

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

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

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

Submission status: Runtime Error

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

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

print("%f" % 1/sum)

Submission status: Runtime Error

Solution code:
import math
from functools import reduce

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

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

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

Submission status: Runtime Error

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

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

M = multi_all(A)

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

Submission status: Runtime Error

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

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

print(1/sum_reverse)

Submission status: Runtime Error

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

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

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

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

    return up / down

print(main())

Submission status: Runtime Error

Solution code:
def main():
    
    n = int(input())
    a = []
    for i in range(n): 
        a.append( 1/int(input()))

    print(1/sum(a))
    

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import numpy as np
n = input()
nlist = []
for i in range(0,int(n)):
    x = input()
    nlist.append(np.reciprocal(float(x)))

sumresu = sum(nlist)
print(np.reciprocal(sumresu))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def main():
    
    n = int(input())
    a = []
    for i in range(n): 
        a.append( 1/int(input()))

    print(sum(a))
    

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
N=int(input())
sum=0.0

for i in range(0,N):
  a=int(input())
  sum+=1/a

print(1/sum)

Submission status: Runtime Error

Solution code:
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
 
def gcd_list(li):
	if len(li) > 2:
		x = gcd(li[-1], li[-2])
		li = li[:-2] + [x]
		return gcd_list(li)
	else:
		return gcd(li[0], li[1])
def main():
    a = int(input())
    lists = list(map(int, input().split()))
    score = []

    bai = gcd_list(lists)

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

    bunbo = sum(score)

    ans = bai /bunbo
    print(ans)


if __name__ == '__main__' :
    main()

Submission status: Runtime Error

Solution code:
N = int(input())

A = int(input().split())

b = sum(reverse(a)) for a in A

print(sum(severse(b)))

Submission status: Runtime Error

Solution code:

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


b = sum(np.reciprocal(a))

print(np.reciprocal(b))

Submission status: Runtime Error

Solution code:
N = int(input())
list_a = [i for i in input()]
 
gyaku_su_list = [1/a for a in list_a]
print(1 / sum(gyaku_su_list))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

sum = 0

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

print(1 / sum)

Submission status: Runtime Error

Solution code:
N = int(input())
l = map(int, raw_input().split())
l = [int(s) for s in l]

total = 0
for i in l:
  total += 1/i

print(1/total)

Submission status: Runtime Error

Solution code:
import numpy as np
n = input()
nlist = []
for i in range(0,int(n)):
    x = input()
    nlist.append(np.reciprocal(float(x)))

sumresu = sum(nlist)
print(np.reciprocal(float(sumresu)))

Submission status: Runtime Error

Solution code:
n = int(input())
ans = 0
for i in range(n):
  a = int(input())
  ans += 1 / a;
print(1 / ans)

Submission status: Runtime Error

Solution code:
n = int(input())
data = map(int, input().split())
up = 0
for i in range(n):
  up *= data[i]
 
down = 0
for j in range(n):
  down += up / data[j]
 
print(up / down)

Submission status: Runtime Error

Solution code:
N = int(input())
list_a = [[i for i in input()] for _ in range(N)]

gyaku_su_list = [1/a for a in list_a]
print(1 / sum(gyaku_su_list))

Submission status: Runtime Error

Solution code:
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

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

    bai = gcd_list(lists)

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

    bunbo = sum(score)

    ans = bai /bunbo
    print(ans)


if __name__ == '__main__' :
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np

N = int(input())
A = [float(input()) for _ in range(N)]

nA = np.array(A)
print(np.reciprocal(np.sum(np.reciprocal(nA))))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

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

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



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

lcm = lcm_list(A_line)
mother = sum(map(lambda x: lcm//x, A_line))

print(lcm/mother)

Submission status: Runtime Error

Solution code:
tmp = int(input())
A = []
for i in range(0,tmp):
    A.append(int(input()))
sum = 0
for i in range(0,tmp):
    sum = sum + 1/A.pop()

print(1/sum)

Submission status: Runtime Error

Solution code:
n = int(input())
l =[]
inv =[]
s = 0
for i in range(n):
    l.append(int(input()))

for i in l:
    i_inv = 1/i
    inv.append(i_inv)

for i in inv:
    s += i
print(1/s)

Submission status: Runtime Error

Solution code:
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
n = int(input())
temp = 1
ans = 0
a = list(map(int, input().split()))
for i in a:
    temp = lcm(temp, i)

for i in a:
    ans +=  int(temp/i)

print(temp/ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

print(1/ans)

Submission status: Runtime Error

Solution code:
n = int(input())
alist = list(map(int, input().split()))
alist = np.array(alist)
gyakulist = 1 / alist
print(1/sum(gyakulist))

Submission status: Runtime Error

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

ans = (A[0] * A[1]) / (A[0] + A[1])

for i in range(2, N):
    ans += (ans * A[i]) / (ans + A[i])

print(ans)

Submission status: Runtime Error

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

for i in A:
    a += 1/i

print(1/a)

Submission status: Runtime Error

Solution code:
_ = int(input())
s = 1 / sum([1 / int(input()) for i in range(_)])
print(s)

Submission status: Runtime Error

Solution code:
import numpy as np

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

A_inv = 1 / A
print(1 / np.sum(A_inv))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
num = int(input())
box = []
for i range(num):
  box.append(1/int(input()))
print(1/sum(box))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

print(1/tmp)

Submission status: Runtime Error

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n = ni()
a = na()

s = 0
for i in range(n):
    s += 1/a[i]
print(f"{1/s:.14f}")

Submission status: Runtime Error

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