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

mother=0

for i in range(0,N):
  mother=mother+1/P[i]

print(1/mother)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

tmp = 0.0
for n in A:
    tmp += (1/n)
else:
    print(1/tmp)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions

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

print(float(1 / sum(fractions.Fraction(1, x) for x in a)))

Submission status: Accepted

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

for v in a:
    ans += (1/v)
print(1/ans)

Submission status: Accepted

Solution code:
a = int(input())
A = list(map(int,input().split()))
B = []
ans = 0

for i in A:
    B.append(1/i)
for i in B:
    ans += i
    
print(1/ans)

Submission status: Accepted

Solution code:
def rev(i):
    rev_i = 1 / i
    return rev_i

n = int(input())
num_ls = input().split()

total_num = 0

for _n in num_ls:
    rev_num = rev(int(_n))
    total_num += rev_num

print(rev(total_num))

Submission status: Accepted

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

Submission status: Accepted

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

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

_ = input()
a = [int(i) for i in input().split()]

for i in a:
    s += 1 / i

s = 1 / s
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

A = [1/a for a in A]

print(1/sum(A))

Submission status: Accepted

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

Submission status: Accepted

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

n = int(input())
a = list(map(int, input().split()))
r_a = ["" for _ in range(n)]


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

print(1/sum)

Submission status: Accepted

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

Submission status: Accepted

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

print(1/c)

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:
A = 0
N = int(input())
num = input().split()

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

Submission status: Accepted

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

while N > 1:
  b = []
  for i in range(0,N-1,2):
    c = (a[i] * a[i+1])/(a[i] + a[i+1])
    b.append(c)
    
  if N % 2 != 0:
    b.append(a[N-1])
    
  a = b
  N = len(a)

print(a[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
a_list = list(map(int, input().split()))

a_sum = 0
for i in range(len(a_list)):
    a_sum += 1 / a_list[i]

print(1 / a_sum)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(1/m)

Submission status: Accepted

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

Submission status: Accepted

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

print(1/a)

Submission status: Accepted

Solution code:
n=int(input())
a=input().split()
b=0
x=0
while b<=n-1:
  y=a[b]
  z=float(1)/float(y)
  x=x+z
  b=b+1
w=1/x 
print(w)

Submission status: Accepted

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

Submission status: Accepted

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

inv_a = [1.0/ai for ai in a]
print(1.0/sum(inv_a))

Submission status: Accepted

Solution code:
n=input()
arr=map(float,raw_input().split())
t=0
for i in arr:
        t+=(1/i)
print 1/t

Submission status: Accepted

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

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

Submission status: Accepted

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

import numpy as np
N = int(input())
A = np.array(input().split(), dtype=np.float64)

answer = 1/(1/A).sum()
print(answer)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

import copy
from functools import reduce
N=int(input())
A=list(map(int,input().split()))

#print(N,A)

den=reduce(lambda x,y:x*y,A)

num=0
for i in range(0,N):
    B=copy.deepcopy(A)
    B[i]=1.0
    num+=reduce(lambda x,y:x*y,B)
#    print(i)

print(den/num)

Submission status: Accepted

Solution code:
n = int(input())
a = {}

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
total_number = int(input())
numbers = list(map(int,input().split()))
reversed = 0
for i in range(total_number):
  reversed += 1 / numbers[i]
sol = 1/reversed
print(sol)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
s=0
n=int(input())
l=list(map(float,input().split()))
la=np.reciprocal(l)
for i in la:
  s=s+i
d=np.reciprocal(s)
print(d)

Submission status: Accepted

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

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

print(1/sum)

Submission status: Accepted

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

Submission status: Accepted

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

# 整数の入力
N = int(raw_input())

li = map(int, raw_input().split())

res = 0

for i in xrange(0,N):
	res += 1/float(li[i])

print 1/res

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
As=[int(x) for x in input().strip().split(" ")]
x=1
for a in As:
    x*=a
rm = 0
for a in As:
    rm+=(x//a)
print(x/rm)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(N):
    A[i] = round((1 / A[i]), 7)


ans = 0

for i in range(N):
    ans += A[i]

ans = round((1 / ans), 7)

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

s = 0

for num in a:
  s += 1 / num
  
print(1 / s)

Submission status: Accepted

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


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


  ans = 1/inv
  print(ans)


if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
n = int(input())
a = input().split()
sum = 0
for l in a:
    sum += (1 / int(l))

print(1 / sum)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

s = 0
for a in A:
    s += prod / a

res = prod / s
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

bunbo = [int(e) for e in input().split()]

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

print (1/wa)

Submission status: Accepted

Solution code:
n = int(input())
resistors = [int(i) for i in input().split()]
reverse = []
for i in range(len(resistors)):
    reverse.append(1 / resistors[i])
print(1 / sum(reverse))

Submission status: Accepted

Solution code:
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac

setrecursionlimit(1000000)


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

def zip(a):
	mae = a[0]
	ziparray = [mae]
	for i in range(1,len(a)):
		if(mae != a[i]):
			ziparray.append(a[i])
			mae = a[i]
	return ziparray

def is_prime(n):
	if n < 2: return False

	for k in range(2, int(math.sqrt(n)) + 1):
		if n % k == 0:
			return False

	return True

def list_replace(n,f,t):
	return [t if i==f else i for i in n]

def base_10_to_n(X, n):
	X_dumy = X
	out = ''
	while X_dumy>0:
		out = str(X_dumy%n)+out
		X_dumy = int(X_dumy/n)
	if(out == ''): return '0'
	return out

def gcd(l):
	x = l.pop()
	y = l.pop()
	while(x%y!=0):
		z = x%y
		x = y
		y = z
	l.append(min(x,y))
	return gcd(l) if len(l) > 1 else l[0]

class Queue():
	def __init__(self):
		self.q = deque([])
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.popleft()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class Stack():
	def __init__(self):
		self.q = []
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.pop()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class graph():
	def __init__(self):
		self.graph = defaultdict(list)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
		self.graph[t].append(f)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
		self.graph[t].remove(f)
	def linked(self,f):
		return self.graph[f]

class dgraph():
	def __init__(self):
		self.graph = defaultdict(set)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
	def linked(self,f):
		return self.graph[f]

main()

Submission status: Accepted

Solution code:
import fractions

def get_lcm(x, y):
    return (x * y) // fractions.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: Accepted

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

print(1 / den_sum)

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:
a = int(input())
b= [int(s) for s in input().split()]

t = list(map(lambda x: 1/x, b))
k = sum(t)

print(1/k)

Submission status: Accepted

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

bunbo=0

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

print(1/bunbo)

Submission status: Accepted

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

for i in list:
  x = x + 1/i

print(1/x)

Submission status: Accepted

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

Submission status: Accepted

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

A_inverse = [1 / a for a in A]

ans = 1 / sum(A_inverse)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
n = int(input())

i = list(map(int, input().split()))
sum = 0;
for j in range(n):
    sum += 1 / i[j]

sum = 1/sum
print(sum)

Submission status: Accepted

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

sum_gyaku = 0

for aa in a:
    sum_gyaku += (1.0 / aa)

print( '{:.10f}'.format(1.0 / sum_gyaku) )

Submission status: Accepted

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

for i in range(n):
    a_sum += a_sup / a[i]

print(a_sup/a_sum)

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
s = [int(i) for i in input().split()]

for i in range(0,N):
  ans = (1 / int(s[i])) + ans

print(1/ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
rep = int(input())
num_list = list(map(int, input().split()))
emp = []
for nums in num_list:
    nums = 1 / nums
    emp.append(nums)
print(1 / sum(emp))

Submission status: Accepted

Solution code:
n = int(input())

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

print(1 / denominator)

Submission status: Accepted

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

Submission status: Accepted

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

x = 0

for i in t:
  x += 1 / i

print(1 / x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
a=[]
r=1
l=0
for i in input().split():
  a.append(int(i))
  r*=int(i)
for i in range(n):
  l+=r/a[i]
print(r/l)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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


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

bunbo = list(map(lambda a:bunshi//a,A))
    

bunbo1 = sum(bunbo)


ans = bunshi/bunbo1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

# print(A)

S = 0

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

print(1/S)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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()))
s=1
for i in l:
    s*=i
q=0
for i in l:
    q+=s//i
print(s/q)

Submission status: Accepted

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

arr = [1/arr[i] for i in range(n)]
print(1 / sum(arr))

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    n = int(input())
    a = [int(k) for k in input().split()]
    p = sum([1 / k for k in a])
    print(1 / p)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(1 / sum)

Submission status: Accepted

Solution code:
from decimal import Decimal

n = int(input())
aaa = list(map(int, input().split()))
div = Decimal(0)
for a in aaa:
    div += Decimal(1) / Decimal(a)
print(Decimal(1) / div)

Submission status: Accepted

Solution code:
import sys
p = [r for r in sys.stdin.read().split('\n') if r != '']
n = int(p[0])
a = [int(c) for c in p[1].split()]
t = 0
for i in a:
    t += 1 / i
print(1 / t)

Submission status: Accepted

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

rev_sum = 0

for a_part in A:
  if a_part != 0:
    rev_sum += 1 / a_part

if rev_sum != 0:
  print(1 / rev_sum)
else:
  print(0)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

su = 0
for i in Lists:
    su += 1/i

print(1/su)

Submission status: Accepted

Solution code:
n = int(input())
an = input().split(" ")
an = list(map(int, an))
#print(an[0],an[1])
bn = list(map(lambda x:1/x, an))
#print(an, bn)
print(1/sum(bn))

Submission status: Accepted

Solution code:
from fractions import Fraction

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy
N = int(input())
A = list(map(float, input().split()))
print(numpy.reciprocal(numpy.sum(numpy.reciprocal(A))))

Submission status: Accepted

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

print(1/r_ans)

Submission status: Accepted

Solution code:
from collections import defaultdict
import sys
import math
from datetime import datetime

def sol(n, S):
    ret = 0
    for s in S:
        #print(s)
        ret += (1.0 / s)
        #print (ret)
    return (1.0/ret)



do_submit = True
#do_submit = False

def input_parse(input_str):
    lines = [x.strip() for x in input_str.split("\n") if x.strip()]
    parsed_lines = [list(map(str, line.split())) for line in lines]
    print(parsed_lines)
    n = int(parsed_lines[0][0])
    S = list(map(int, parsed_lines[1]))
    # S = parsed_lines[1][0]
    # return n, k, S
    return n, S


if not do_submit:
    n, S = input_parse("""
    2
    10 30
    """)
    print(sol(n, S))

    n, S = input_parse("""
    3
    200 200 200
    """)
    print(sol(n, S))

    n, S = input_parse("""
    1
    1000
    """)
    print(sol(n, S))



else:
    n = int(input().strip())
    S = list(map(int, input().split()))
    #S = input().split()
    # print(sol(n, k, S))

    #s = input().strip()
    # S = input().strip()
    print(sol(n, S))

Submission status: Accepted

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

AAAinved = [1/a for a in AAA]

print(1/sum(AAAinved))

Submission status: Accepted

Solution code:
x=int(input())
a=[]
n=input().split(" ")
for i in range(0,x):
    a.append(int(n[i]))
s=1
for j in range(0,len(a)):
    s = s * a[j]
t=1
sum=0
for k in range(0,len(a)):
    t=s/a[k]
    sum=sum+t
print(s/sum)

Submission status: Accepted

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

print(float(Fraction(1,sum(a))))

Submission status: Accepted

Solution code:
import functools
import fractions

def gcd_list(numbers):
    return functools.reduce(fractions.gcd, numbers)


N = int(input())
a_list = [int(i) for i in input().split(' ')]

gcd = gcd_list(a_list)
div = sum(map(lambda x: (gcd / x), a_list))
print (gcd / div )

Submission status: Accepted

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

Submission status: Accepted

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

g = 0

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

print(1 / g)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import Fraction

n = int(input())

num_list = [Fraction(1,int(i)) for i in input().split()]

temp_list = 0
for fr in num_list:
    temp_list += fr

print(float(Fraction(temp_list.denominator,temp_list.numerator)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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:
from fractions import Fraction

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

summ = 0

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

print(float(Fraction(1, summ)))

Submission status: Accepted

Solution code:
import fractions
N = int(input())
T = list(map(int, input().split()))
ans = T[0]
for i in range(1, N):
    ans = ans * T[i] // fractions.gcd(ans, T[i])
#print(ans)

sum = 0
for i in range(0,N):
    sum += ans / T[i]

print(ans / sum)

Submission status: Accepted

Solution code:
import numpy as np
if __name__ == '__main__':
	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()))
print(1/sum([1/x for x in a]))

Submission status: Accepted

Solution code:
from fractions import Fraction
N = int(input())
aLst = list(map(int, input().split()))
ansLst = []
for i in range(N):
    ansLst.append(Fraction(1, aLst[i]))

print(float(Fraction(1, sum(ansLst))))

Submission status: Accepted

Solution code:
n=int(input())
an=[int(i) for i in input().split()]
num=0
for j in range(n):
    num+=1/an[j]

print(1/num)

Submission status: Accepted

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

num = 0
test = []
for i in range(n):
    test.append(1 / a[i])
    
    num = (1 / (sum(test)))

print(num)

Submission status: Accepted

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

s = reduce(lambda x,y:x*y,a)
b = sum(map(lambda x:s/x,a))

print float(s)/float(b)

Submission status: Accepted

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

print (1 / k)

Submission status: Accepted

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

A=[i for i in range(N)]

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

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

print(1/sum)

Submission status: Accepted

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

Submission status: Accepted

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

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

print "%.10f"%(1 / ans )

Submission status: Accepted

Solution code:
N = int(input())
data = list(map(int, input().split()))
multi = 1
each = 0
for num in data:
    multi *= num

for num in data:
    each += multi/num

print(multi/each)

Submission status: Accepted

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

t = [1 / i for i in a]
result = 1 / sum(t)

print(result)

Submission status: Accepted

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

sum=A[0]
if N==1:
    sum=float(sum)

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

sum_end=float(sum)
print(sum_end)

Submission status: Accepted

Solution code:
# やっておしまい
n = int(input())
arr = list(map(int, input().split()))
wa = 1.0/arr[0]
for i in range(1, n):
  wa += 1.0/arr[i]

print(1/wa)

Submission status: Accepted

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

Submission status: Accepted

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

print(1/sum(a))

Submission status: Accepted

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

Submission status: Accepted

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

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

print(1/M)

Submission status: Accepted

Solution code:
from operator import add
from functools import reduce

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


def back(x):
    return 1 / x


l = list(map(back, int_list))
print(1/(reduce(add, l)))

Submission status: Accepted

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

Submission status: Accepted

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

inv_a = [1/i for i in a]
result = 1/sum(inv_a)

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def A():
    a = int(input())
    s = str(input())
    if a<3200:
        print('red')
    else:
        print(s)

def B():
    n = int(input())
    a = input().split()
    s = 0
    for i in range(n):
        s += (1/int(a[i]))
    print(1/s)

B()

Submission status: Accepted

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

x = [0]*n

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

print(1/sum(x))

Submission status: Accepted

Solution code:
from fractions import Fraction

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

b = 0
c = Fraction(0)

for i in range(n):
    b = Fraction(1, int(a[int(i)]))
    c = c + b

c = Fraction(c.denominator, c.numerator)


print(float(c))

Submission status: Accepted

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

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

i = 0
B = 0
while i <= N-1:
  B += 1/int(A[i])
  i += 1
  
print(1/B)

Submission status: Accepted

Solution code:
N       = int(input())
numbers = input()

A = list()
A = numbers.split(" ")

sum1 = 0

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

sum2 = 1/sum1

print(sum2)

Submission status: Accepted

Solution code:
#! /usr/bin/env python
# -*- coding: utf-8 -*

from fractions import gcd

def main():
    n = int(raw_input())
    l = map(int, raw_input().split())

    pr = 1
    for e in l:
        pr *= e

    denum = 0

    for e in l:
        denum += pr / e

    g = gcd(pr, denum)
    pr /= g
    denum /= g

    print 1.0 * pr / denum

if __name__ == "__main__":
    main()