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 = input()
As = input().split()
F = [1/int(x) for x in As]
print(1/sum(F))

Submission status: Accepted

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

t = 0

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

Submission status: Accepted

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

print(1/total)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
a=0.0
for i in input().split():
  a+=1.0/float(i)
print(1.0/a)

Submission status: Accepted

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

denomina = 0
for s in ss:
    denomina += 1/s

print(1/denomina)

Submission status: Accepted

Solution code:
def resistors_in_parallel(N: int, A: list)->float:
    return 1.0 / sum(1.0/a for a in A)


if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))

    ans = resistors_in_parallel(N, A)
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
nums = map(int, input().split())
 
print(1 / sum(1 / num for num in nums))

Submission status: Accepted

Solution code:
import sys,math,itertools,bisect,copy,re

from collections import Counter, deque, defaultdict
from itertools import accumulate, permutations, combinations, takewhile, compress, cycle
from functools import reduce
from math import ceil, floor, log10, log2, factorial
from pprint import pprint
# 10倍速いらしい
input = sys.stdin.readline

INF = float('inf')
MOD = 10**9+7
EPS = 10**-7
sys.setrecursionlimit(1000000)

# N = int(input())
# N,M = [int(x) for x in input().split()]
# V = [[0] * 100 for _ in range(100)]
# A = [int(input()) for _ in range(N)]
# DP = [[0] * 100 for _ in range(100)]
# DP = defaultdict(lambda: float('inf'))

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B

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

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

Submission status: Accepted

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

total=0
for a in a_list:
    total+=1/a

print(1/total)

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 = [int(i) for i in input().split()]
b = 0.0
c = 0.0
for i in a_list:
  c = 1/i
  b += c
result = 1/b
print(result)

Submission status: Accepted

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

A_inverse = [1/i for i in A]
print(1/sum(A_inverse))

Submission status: Accepted

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

product = 1
sum = 0
for num in list:
    product *= num

for num2 in list:
    sum += product / num2
print(product / sum)

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 heapq import heappush, heappop
import re
from collections import deque
import sys
import math
input = sys.stdin.readline


def int_raw():
    return int(input())

def str_in():
    return input().strip("\n")

def ss_raw():
    return input().split()


def ints_raw():
    return tuple(map(int, ss_raw()))


DIV = 10**9+7


def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


def ncr(n, r, mod=DIV):
	r = min(r, n-r)
	ret = 1
	for i in range(1, r+1):
		ret = ret * (n-i+1) % mod
		ret = ret * mod_inv(i, mod) % mod
	return ret


class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)
        self.mini = [i for i in range(n+1)]

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
        mini = min(self.mini[x],self.mini[y])
        self.mini[x]=mini
        self.mini[y]=mini
    
    def same_check(self, x, y):
        return self.find(x) == self.find(y)

def main():
    n = int_raw()
    As = ints_raw()
    return 1.0/sum([1.0/a for a in As])
    
print(main())

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
b = [1 / i for i in list(map(int, input().split()))]
print(1 / sum(b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
count = input()
number_list = input().split()
sum = 0

for n in range(int(count)):
  sum += 1 / int(number_list[n])

result = 1 / sum

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x = []
for i in range(len(A)):
    x.append(1/A[i])
    bunbo = sum(x)
print(1 / bunbo)

Submission status: Accepted

Solution code:
d = input()
a = input().split()
r = 0
for i in a:
    r += 1 / int(i)
print(1 / r)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = 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:
n = int(input())
alist = list(map(int, input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a_list = input().split()

bumbo = 0
for a in a_list:
    bumbo += 1.0 / int(a)

print(1.0/bumbo)

Submission status: Accepted

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

Submission status: Accepted

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

b = 0.0

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

Submission status: Accepted

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

for a in al:
    sum += 1/a

print(1/sum)

Submission status: Accepted

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

#脳筋
#for i in range(len(list)):
#    josu += 1/list[i]

#ans = 1/josu


#ちょい工夫？
all_jousu = 1
for i in range(len(list)):
    all_jousu *= list[i]

josu = 0
for i in range(len(list)):
    josu += all_jousu/list[i]

ans = all_jousu/josu



print(ans)

Submission status: Accepted

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

print(1/sum)

Submission status: Accepted

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

r = 1.0 / sum([1 / a for a in aa])

print(r)

Submission status: Accepted

Solution code:
import math
import sys
import numpy as np
from collections import defaultdict, deque, Counter 
from itertools import accumulate, product, permutations,combinations, combinations_with_replacement
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd

max_value = 1000000000
min_value = -1000000000
sys.setrecursionlimit(max_value)


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


b_list = [1./e for e in a_list]

b = np.sum(b_list)

print(1/b)

Submission status: Accepted

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

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

lower = 0
for a in array:
    lower += 1 / a

print("{}".format(1 / lower))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import numpy as np


#横並び
#a, b, c, x = map(int, [input() for i in range(4)])
#z = list(map(int, input().split()))
#n, a, b = map(int, input().split())

#print(len(z))
#for i in z:
#    print(i)

#a = sorted(a,reverse = True)
#print(sum(a[::2]) - sum(a[1::2]))
#z = map(int, [input() for i in range(int(n))])
#data_list = [ list(map(int,input().split(" "))) for i in range(3)]


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


print(1/k)

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

out = 0
for i in range(N):
  out += 1.0 / A[i]

  
print(1.0 / out)

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("{:.6f}".format(1/sum))

Submission status: Accepted

Solution code:
n = int(input())
values = input().split()
before_reverse_num = 0
for _ in range(n):
  before_reverse_num += 1 / int(values[_])
after_reverse_num = 1 / before_reverse_num
print(str(round(after_reverse_num,5)))

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
print(sum(map(lambda x: x**-1, A))**-1)

Submission status: Accepted

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

print(1/s)

Submission status: Accepted

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

A_sum = 0
for i in A:
    A_sum += 1/i
    
print(1/A_sum)

Submission status: Accepted

Solution code:
from functools import reduce
input()
l=list(map(lambda x: (1 /int(x)), input().split()))
sum = reduce((lambda x, y: x + y), l) 
print (1/sum)

Submission status: Accepted

Solution code:
import numpy as np

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

A_sum = 0
for i in A:
    A_sum += 1/i
    
print(1/A_sum)

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
A_array = np.array([int(x) for x in input().split()])

a_array = np.sum(1/A_array)
print(1/a_array)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

n= int(input())
lst = [float(x) for x in input().split()]
print(1 / sum(np.reciprocal(lst)))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from decimal import Decimal

cnt = int(raw_input())
elements = map(lambda x: Decimal(str(x)), raw_input().split())
div_elements = map(lambda x: 1 / x , elements)
print 1 / sum(div_elements)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

ans = 0
tmp = 0

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

ans = 1/tmp
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

num = map(int,input().split())
sum = 0
for i in num:

    sum += 1/i

answer = 1 / sum

print(answer)

Submission status: Accepted

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

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

Submission status: Accepted

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

answer = 0.0

for a in Ai:
    answer += 1 / a

print(1 / answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import io
import sys
MOD = 10 ** 9 + 7

def IN_S():
  return input()


def IN_I():
  return int(input())


def IN_L_I():
  return list(map(int, input().split()))


def IN_L_S():
  return list(map(str, input().split()))


def STR_SPLIT(s, n):
  for l in range(0, len(s), n):
    yield s[0 + l:n + l]


def T_IN():
  global test_str
  sys.stdin = io.StringIO(test_str[1:-1])


test_str = '''
3
200 200 200
'''


def MAIN():
  # T_IN()
  A()


def A():
  n = IN_I()
  nums = IN_L_I()
  t = 0
  for num in nums:
    t += 1 / num
  
  print (1 / t)
  return None


def B():
  return None


def C():
  return None


MAIN()

Submission status: Accepted

Solution code:
N = int(input())

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

ans = 0

for a in L:
    ans += (1/a)

ans = 1 / ans

print('{:.6f}'.format(ans))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(1/s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
#x, y = map(int, input().split())
#a = [list(map(int, input().split())) for _ in range(N)]
a = list(map(int, input().split()))
#s = input()
for i in range(N):
    a[i] = a[i]**-1  
ans = sum(a)
print(ans**-1)

Submission status: Accepted

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

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

print(1/ans)

Submission status: Accepted

Solution code:
N = 0
numbers = []

N = int(input())
numbers = [1/int(i) for i in input().split()]

print(1/sum(numbers))

Submission status: Accepted

Solution code:
n = int(input())

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

mother = 0

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

print(1/mother)

Submission status: Accepted

Solution code:
input();a=map(lambda a: 1/int(a),input().split())
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=sum+(1/a[i])
print(1/sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = [float(x) for x in input().split()]
from math import fsum

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = int(input())
string = input().split()
nums = [int(i) for i in string]

def inverse(n):
  return 1/n

inverseNums = [inverse(i) for i in nums]

sumInverseNums = sum(inverseNums)

print(inverse(sumInverseNums))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
inf=float('inf')
mod = 10**9+7
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N=I()
    A=LI()
    S = 0
    for a in A:
        S+=1/a
    print(1/S)
    

if __name__ == '__main__':
    main()

Submission status: Accepted

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

res = 1/sum(list(map(lambda x: 1/x, As)))

print(res)

Submission status: Accepted

Solution code:
import numpy as np

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

A = np.array(A)
A = 1 / A
ans = 1 / A.sum()
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = [int(a) for a in input().split()]
ans = 0
for a in A:
    ans += round(1 / a, 10)
print(round(1 / ans, 7))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 0.0
for i in l:
    ans += 1 / i


print(1 / ans)

Submission status: Accepted

Solution code:
# coding: utf-8
from itertools import *
import sys
import time


#################### library ####################


#################### naive ####################


#################### process ####################

def read_array():
	N = int(input())
	A = map(int, raw_input().split())
	return A


#################### main ####################

#t0 = time.clock()
A = read_array()
print 1./sum(1./a for a in A)
#print >>sys.stderr, "%.6fsec" % (time.clock() - t0,)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

if __name__ == "__main__":
    n = int(input())
    a = list(map(int, input().split()))
    ans = 0
    for i in range(n):
        ans += 1.0/a[i]
    print(1/ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
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())
l=list(map(int,input().split()))

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

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:
from functools import reduce


n = int(input())
A = list(map(int, input().split()))
if n == 1:
    print(A[0])
else:
    numerator = reduce(lambda a, b: a * b, A)
    denominator = 0
    for i in range(n):
        denominator += reduce(lambda a, b: a * b, A[:i] + A[i+1:])
    print(1.0 * numerator / denominator)

Submission status: Accepted

Solution code:
n = int(input())
numbers = input()
numArr = str.split(numbers)
sum = 0
for i in range(n):
    sum += 1/int(numArr[i])
print(1/sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

s = sum(a)

print(1/s)

Submission status: Accepted

Solution code:
N = int(input())
Array = list(map(int,input().split()))
sum = 0.0
for i in Array:
    sum+=(1/float(i))
print(1/sum)

Submission status: Accepted

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

sum = 0.0
for x in a:
  sum = sum + 1 / x

print(1/sum)

Submission status: Accepted

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

#脳筋
for i in range(len(list)):
    josu += 1/list[i]

ans = 1/josu


#ちょい工夫？
# all_jousu = 1
# for i in range(len(list)):
#     all_jousu *= list[i]
#
# josu = 0
# for i in range(len(list)):
#     josu += all_jousu/list[i]
#
# ans = all_jousu/josu



print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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

print(float(1/ans))

Submission status: Accepted

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

Submission status: Accepted

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

temp = 0
for aa in a:
    temp += 1 / aa

print(1 / temp)

Submission status: Accepted

Solution code:
# B - Resistors in Parallel

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

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

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

Submission status: Accepted

Solution code:
N = input()
list = []
list = [int(x) for x in input().split()]
wa = 0
for x in list:
    wa += 1/x

print(1/wa)

Submission status: Accepted

Solution code:
import sys
from fractions import Fraction
input = sys.stdin.readline


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


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

Submission status: Accepted

Solution code:

def get_answer(n, a):
    n = int(n)
    a = [int(v) for v in a.split(" ")]
    aa = [1/v for v in a]

    return 1 / sum(aa)


if __name__ == "__main__":
    input1 = input()
    input2 = input()
    print(get_answer(input1, input2))

Submission status: Accepted

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
s=0

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

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

print(1/s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
total_1 = 1
total_2 = 0
al = list(map(int,input().split()))
for x in al:
    total_1 *= x
for y in al:
    total_2 += total_1/y
answer = total_1/total_2
print(answer)

Submission status: Accepted

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

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

print(1/a)

Submission status: Accepted

Solution code:

N = int(input())

lst_A = input().split()
total = 0

for i in range(len(lst_A)):
    lst_A[i] = float(lst_A[i])
    total += 1/lst_A[i]

ans = 1/total

print(ans)

Submission status: Accepted

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

for i in range(len(a)):
    total += 1/a[i]

print(1/total)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
input = input()
input_array = input.split(" ")
for item in input_array:
    ans=ans+1.0/int(item)
print(1/ans)

Submission status: Accepted

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

print(1/A)

Submission status: Accepted

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

# print(S)

sum1=0
sum2=1

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



A=1/sum1
print(A)

Submission status: Accepted

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

a_inv = [0] * N

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

a_inv_sum = sum(a_inv)

print(1 / a_inv_sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce

def gcd_base(x,y):
    while y!=0:
        x,y = y,x%y
    return x

def gcd(num):
    return reduce(gcd_base,num)

def lcm_base(x,y):
    return (x * y) // gcd_base(x,y)

def lcm(num):
    return reduce(lcm_base,num,1)

def calc_denom(l,numer):
    cnt = 0
    for x in l:
        cnt += numer//x
    return cnt

N = int(input())
l = list(map(int,input().split()))
numer = lcm(l)
denom = calc_denom(l,numer)
print(numer/denom)

Submission status: Accepted

Solution code:
from fractions import Fraction
n = int(input())
a = list(map(lambda x: Fraction(1, int(x)), input().split()))
print(float(Fraction(1, sum(a))))

Submission status: Accepted

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

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

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

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

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

Submission status: Accepted

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

total2 = 1 / total
print(total2)

Submission status: Accepted

Solution code:
#Coding:Utf-8

N=int(input())
A=list(map(int, input().split()))
total=0
for i in range(N):
    total+=1/A[i]
else:
    total=1/total

print(total)

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]

print(1/s)

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

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

ans = 1/sum(1/np.array(a))
print(ans)

Submission status: Accepted

Solution code:
from fractions import Fraction
N = int(input())
li = list(map(int, input().split()))
A = 0
for i in range(N):
  A += Fraction(1, li[i])
print(A.denominator / A.numerator)

Submission status: Accepted

Solution code:
from functools import reduce

n = int(input())

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

numerator = prod = reduce(lambda x, y: x*y, arr)
denomenator = sum(prod//ele for ele in arr)

ans = numerator/denomenator
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

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

b=[s/a[j] for j in range(n)]

print(s/np.sum(b))

Submission status: Accepted

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