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(float, input().split()))
s = 0.0
for i in range(n):
    a[i] = 1 / a[i]
    s += a[i]
s = 1 / s
print(s)

Submission status: Accepted

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

score = 0
for value in list:
  score += 1 / value

print(1 / score)

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import bisect

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

def LI(): return list(map(int, sys.stdin.readline().split()))

N = int(input())
A = LI()


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

wa=0
for i in range(num):
    wa=wa+(1/array[i])
print(1/wa)

Submission status: Accepted

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

Submission status: Accepted

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

b = 0
for x in a:
    b += 1/x

print(1/b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import Fraction
input()
s=map(int, input().split())
s=[Fraction(1, i) for i in s]
s=Fraction(1, sum(s))
res=s.numerator / s.denominator
print(res)

Submission status: Accepted

Solution code:
import math
import copy
import sys


inputa = input().split()
# inputb = input().split()
# inputc = input().split()

a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

# inputaList = [int(n) for n in inputa]

inputb = input().split()
inputbList = [float(n) for n in inputb]
#
# inputList = []
# inputNumList = []
# for i in range(a):
#     inputNum = input()
#     inputNumList = list(inputNum)
#     inputList.append(inputNumList)

# inputList = [int(n) for n in inputList]

# b = [int(n) for n in inputb]
# c = [int(n) for n in inputc]

tmpSum = 0

for i in range(a):
    tmpSum += 1/inputbList[i]

print(1/tmpSum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(1/b)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

for i in a:
    ans += 1 / i

print(1 / ans)

Submission status: Accepted

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

A = 0

for x in nums:
    A += 1 / x

print(1 / A)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(1 / sum(A))

Submission status: Accepted

Solution code:
_ = int(input())
ales = sorted(list(map(int, input().split())))[::-1]
def gcd(a, b):
  while b != 0:
    a, b = b, a%b
  return a
def lcm(a, b):
  return a * b / gcd(a, b)
k = ales[0]
for a in ales[1:]:
  k = lcm(k, a)
numerator = int(k/ales[0])
for a in ales[1:]:
  numerator += int(k/a)
print(k/numerator)

Submission status: Accepted

Solution code:
int(input())
lst = map(int,input().split(" "))
bunsi = 1
bunbo = 0
for e in lst:
    bunbo += 1/e
    
print(bunsi / bunbo)

Submission status: Accepted

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

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

Submission status: Accepted

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

acc = 0

for i in a:
    acc += 1/i

print(1/acc)

Submission status: Accepted

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

Submission status: Accepted

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

rev = []
for a in A:
  rev.append(1.0/float(a))
  
print(1.0/float(sum(rev)))

Submission status: Accepted

Solution code:
# -*- coding utf-8 -*-
MOD = 10 ** 9 + 7

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

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

print(1/ans)

Submission status: Accepted

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


print(1 / result)

Submission status: Accepted

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

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

print(1/rev)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(1 / b)

Submission status: Accepted

Solution code:
N = int(input())
A = map(int, input().split())
print("{:.16f}".format( 1 / sum(1 / x for x in 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 = map(lambda x: 1 / float(x), A)
sum_A = sum(A)
ans = 1/sum_A

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from operator import itemgetter

def main():
	n = int(input().strip())
	v = list(map(int, input().strip().split()))
	d = sum(1/x for x in v)
	print("{:.5f}".format(1/d))

if __name__ == '__main__':
	main()

Submission status: Accepted

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

temp = 0

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

ans = 1/temp

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(1/ans)

Submission status: Accepted

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

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

def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
sum = 0
a = input().split(" ")
a_list = [int(j) for j in a]
for k in a_list:
    sum += 1/k
print(1/sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# Nの入力
n = int(input())
# スペース区切りの整数の入力
a = map(float, input().split())
sum = 0.0
for e in a:
	sum += 1/e
print(1/sum)

Submission status: Accepted

Solution code:
def solve(n, a):
    res = 0
    for i in range(n):
        res += 1.0 / a[i]
    return 1.0 / res

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
_ = input()
A = list(map(int, input().split()))

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


denominator = 0
for a in range(len(A)):
    denominator += (numerator / A[a])


# print(numerator, denominator)
print(numerator / denominator)

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

Submission status: Accepted

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: Accepted

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

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

Submission status: Accepted

Solution code:
from decimal import *
input()
N = list(map(int, input().split()))
count = sum(map(lambda x: Decimal(1) / Decimal(x), N))
print(float(Decimal(1) / Decimal(count)))

Submission status: Accepted

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

denominator = 0
for i in a:
    denominator += 1 / i
dst = 1 / denominator
print(dst)

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

Submission status: Accepted

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

Submission status: Accepted

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

rA = list(map(lambda x:1/x,A))
ans = 1/sum(rA)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
B = 0 #Bを先に定義しておく

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

Submission status: Accepted

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

Submission status: Accepted

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


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

    for ai in a:
        total += 1 / ai

    print(1 / total)


if __name__ == '__main__':
    main()

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:
total_num = int(input())
numbers = input().split()
reverse_sum = 0

for number in numbers:
  reverse_sum += 1 / int(number)
  
answer = 1 / reverse_sum

print(answer)

Submission status: Accepted

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

print(1 / sum([ 1. / x for x in A]))

Submission status: Accepted

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

p = s
q = 0
for i in range(n):
	q += s / a[i]
print("%.6lf" % (p / q))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

s = 0
for e in a:
    s += 1 / e

print(1 / s)

Submission status: Accepted

Solution code:
import sys
from operator import itemgetter #sortedの対象を決めたい
from fractions import gcd #最大公約数求めたい
from math import ceil, floor, sqrt #小数点切り上げ、切り捨て、平方根求めたい
from copy import deepcopy #参照で影響されないコピーが作られる
from collections import Counter, deque #要素ごとの出現回数を数える。双方向アクセス可能データ型
import heapq
from functools import reduce
sys.setrecursionlimit(200000)

input = sys.stdin.readline
# template



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

Submission status: Accepted

Solution code:
n = int(input())
a_seq = list(map(int, input().split()))
b_seq = [0] * n

for i in range(n):
    b_seq[i] = 1 / a_seq[i]

ans = 1 / sum(b_seq)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
a = input()
l = a.split()
temp = 0
for num in l:
  temp = temp + 1/int(num)

print(1/temp)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 整数の数の入力
N = int(input())

# 数列の入力
A = list(map(int, input().split()))

# 数列の逆数を計算
for i in range(len(A)):  
  A[i] = 1 / A[i]

# 数列の逆数の総和の逆数を出力
print("{}".format(1 / sum(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:
N=int(input())
print(1/sum([1/i for i in list(map(int,input().split()))]))

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())
m = list(map(int,input().split()))
o = []
for i in m:
  o.append(1/int(i))
s = sum(o)
print(1/s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(1/sum)

Submission status: Accepted

Solution code:
input()
print(1/sum(1/int(s) for s in input().split()))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- encoding=utf-8 -*-
N = int(input())
A = list(map(int, input().split(' ')))
div_a = []
for a in A:
  div_a.append(1/a)
print(1/sum(div_a))

Submission status: Accepted

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

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 = input()
try:
    n = int(n)
    
    v = [int(x) for x in input().split(' ')]
    
    sum = 0
    for i in range(len(v)):        
        sum += 1/v[i]
        
    sum = 1 / sum
    print(sum)

    
except ValueError:
    print("数値を入力してください")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
A_list = list(map(int,input().split()))
#A_listを逆数化

sum=0

for i in A_list:
    sum += ( 1/i)
    
print(1/sum)

#A=sum(A_list)
#B=1/A
#print(1/B)z

Submission status: Accepted

Solution code:
#Ryucoderの競プロ配信
N = int(input())
k = list(map(int,input().split()))
sum = 0
for i in range(N):
    sum += 1/k[i]
print(1/sum)

Submission status: Accepted

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

# A1...Anの積を求める
p = 1
for a in A_list :
    p *= a

bunbo = 0
for a in A_list :
    bunbo += p/(1.0*a)

print(p/bunbo)

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

print(str(1 / sum(1 / int(i) for i in input().split(' '))))

Submission status: Accepted

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

sum = 0

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

Submission status: Accepted

Solution code:

N = int(input())
#s = input()
#S = []
#for i in range(N):
S = input().split(" ")
SUM = 0
for i in range(N):
    temp = int(S[i])
    temtem = 1 / temp
    SUM += temtem
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())
res = [1/int(x) for x in input().split()]
print(1/sum(res))

Submission status: Accepted

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

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

print(1/reverse_result)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# sys.stdin.readlineの練習
# __main__の練習
def main():
    import sys
    input = sys.stdin.readline
    n = int(input())
    a = list(map(int, input().split()))
    print(1.0/sum(list(map(lambda x: 1.0 / x, a))))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# sys.stdin.readlineの練習
import sys
input = sys.stdin.readline
def main():
    n = int(input())
    a = list(map(int, input().split()))
    print(1.0/sum(list(map(lambda x: 1.0 / x, a))))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
print(1.0/sum(list(map(lambda x: 1.0 / x, a))))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split(" ")))
prod, mother = 1, 0
for i, v in enumerate(A):
    prod *= v

for i, v in enumerate(A):
    mother += (prod // v)

print(prod/mother)

Submission status: Accepted

Solution code:
from decimal import Decimal
n = int(input())
a = [Decimal(c) for c in input().split()]
print(1/sum(1/a_i for a_i in a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
import operator
N = int(input())
A = [int(_) for _ in input().split()]
P = list(itertools.accumulate(A, func=operator.mul))[-1]
print(P / sum(P // a for a in 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()))

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 += float(1 / A[i])
print(1 / ans)

Submission status: Accepted

Solution code:
from functools import reduce

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
N = int(input())
A = list(map(int, input().split()))
under = 0
for a in A:
    under += 1/a
print(1 / under)

Submission status: Accepted

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

rev_sum = 0
for ll in l:
    rev_sum += 1/ll

ans = 1/rev_sum

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    N = int(input())
    A = list(map(int, input().split()))
    
    A_sum = 0
    
    for i, v in enumerate(A):
        A_sum = A_sum + (1 / v)
        
    print(1 / A_sum)
    
        
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
num = int(input())

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

a = 0

for i in x:
  a += 1/i

print(1/a)

Submission status: Accepted

Solution code:
c=int(input())
n=list(map(int, input().split()))
denominator=0
i=0
while True:
  if i == c:
    break
  denominator += 1/n[i]
  i+=1
print(1/denominator)

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

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

Submission status: Accepted

Solution code:
denominator = 0
n = int(input())
a = map(int, input().split())
for value in a:
    denominator += (1/value)
ans = 1 / denominator
print("{: .6f}".format(ans))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np
 
N = input()
As = input().split()
list_inp = [int(a) for a in As]

output = np.float(0)
for a in list_inp:
  output += 1/np.float(a)


print(1.0/output)

Submission status: Accepted

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

sum = 0

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

ans = 1 / sum

print(ans)

Submission status: Accepted

Solution code:
def solve():
    num = int(input())
    intTuple = tuple(map(int, input().split()))
    inverts = tuple(map(lambda x: 1 / x, intTuple))
    print(1 / sum(inverts))

solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
denominator = 0
n = int(input())
a = map(int, input().split())
for value in a:
	denominator += (1/value)
ans = 1 / denominator
print("{: .6f}".format(ans))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
n=int(input())
aa=map(int,input().split())
print(1/sum(1/a for a in aa))

Submission status: Accepted

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

import sys


n = int(sys.stdin.readline())
a = [int(x) for x in sys.stdin.readline().strip().split(" ")]

a = sum([1.0 / x for x in a])
a = 1.0 / 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/float(A[i])

print(1/ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Resistors in Parallel
N = input()
A = list(map(int, input().split()))

A = list(map(lambda x: 1/x, A))
ans = 1/sum(A)

print(ans)

Submission status: Accepted

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

mo = 0
for i in range(len(A)):
    mo = mo + 1/A[i]

print(1/mo)

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
num = list(map(float,input().split()))
print(1/sum(np.reciprocal(num)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
c = 1.0 / sum([1.0 / x for x in map(int, input().split(" "))])
print("%.7f" % c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
_,a=open(0);print(1/sum([1/int(i) for i in a.split()]))

Submission status: Accepted

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

#print(al)
total=0
for a in al :
  f=float(a)
  total+=1.0/f
  
ans=1.0/total
print('{:.7f}'.format(ans))

Submission status: Accepted

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

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

S = list(map(int,input().split()))
num_list = []

for num in S:
    num_list.append(1/num)

total_sum = sum(num_list)


print(1/total_sum)

Submission status: Accepted

Solution code:
num = 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 = [int(a) for a in input().split()]
ans=0
for i in A:
  div= 1 / float(i)
  ans += div
print( 1 / ans)

Submission status: Accepted

Solution code:

import bisect
import collections
import itertools


def getint(): return int(input())
def getints(): return list(map(int, input().split()))
def getint2d(rows): return [getints() for _ in range(rows)]
def getgrid(rows): return [input() for _ in range(rows)]
def array1d(n, value): return [value for _ in range(n)]
def array2d(n, m, value): return [array1d(m, value) for _ in range(n)]

n = getint()
values = getints()

res = 0.0
for v in values:
    res += 1.0 / v

print(1.0 / res)

Submission status: Accepted

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