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:
import numpy as np
N = int(input())
A = list(map(int, input().split()))
for i in range(len(A)):
    A[i] = 1/ A[i]

a = sum(A)
print(1/a)

Submission status: Accepted

Solution code:
from fractions import Fraction

N = int(input())
l = list(map(int, input().split()))
under = 0

for i in range(N):
  under += Fraction(1, l[i])

result = float(Fraction(1, under))

print(result)

Submission status: Accepted

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

ans = int(0)

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

print(1/ans)

Submission status: Accepted

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

ans = 0

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

print(1 / ans)

Submission status: Accepted

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

Submission status: Accepted

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

max = 0
sum = 0

for i in range(n):
  a = int(A[i])
  if a > max:
    max = a

for i in range(n):
  sum += max/int(A[i])

print(max/sum)

Submission status: Accepted

Solution code:
N = int(input())
li = list(map(int,input().split()))
bo = 0
shi = 1
for i in range (N):
    shi *= li[i]
for i in range(N):
    k = 1
    m = 1
    for j in range(i):
        k *= li[j]
    for n in range(i+1,N):
        m *= li[n]
    bo += k*m
print('{:.10g}'.format(shi/bo))

Submission status: Accepted

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

ans = 0

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

print(1./ans)

Submission status: Accepted

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

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

print(1 / total)

Submission status: Accepted

Solution code:
N=int(input())
Alist=[int(n) for n in input().split()]
bunnshi=1
for i in Alist:
    bunnshi *= i

bunnbo=0
for i in Alist:
    bunnbo += bunnshi/i

Ans=bunnshi/bunnbo
print(Ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A_list = list(map(int,input().split()))
sum_list = []
for i in range(N):
    sum_list.append(1/A_list[i])

Sum = sum(sum_list)
print(1/Sum)

Submission status: Accepted

Solution code:
import sys
inputs = sys.stdin.readlines()

n = int(inputs[0])
a_list = list(map(int, inputs[1].split()))

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

Submission status: Accepted

Solution code:
import random
import math
import collections
import itertools
import functools
import operator
import os
import sys

ri = lambda: map(int, raw_input().split())
def pi(a): print (' '.join(map(str, a)))

from fractions import Fraction
n = input()
a = ri()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(n:int, l:list):
    cnt = 0
    for i in range(n):
        cnt += 1/l[i]
    return 1/cnt

def main():
    n = int(input())
    l = list(map(int, input().split(" ")))
    print(solve(n, l))

if __name__ == "__main__":
    main()

Submission status: Accepted

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

res = 0
for e in a:
    res += 1/e
print(1/res)

Submission status: Accepted

Solution code:
#coding: utf-8
n = int(input())
numbers = list(map(int,input().split()))
sum = 0
ans = 0

for i in range(len(numbers)):
	sum = sum + 1 / numbers[i]

ans = 1 / sum

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

*A, = 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())
a_list = list(map(int,input().split()))
total = 1
total2 = 0

for a in a_list:
    total = total * a
for a in a_list:
    total2 = total/a + total2

print(total/total2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
import fractions
from functools import reduce

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

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
lcm = lcm(*a)
li = []
for i in range(n):
    li.append(lcm // a[i])
print(lcm/sum(li))

Submission status: Accepted

Solution code:
n=int(input())
apai=1
ans=0
a =list(map(int,input().split()))
for i in a:
	apai*=i
for i in range(n):
	A=a.copy()
	A[i]=1
	data = 1
	for j in A:
		data*=j
	ans+=data
print(round(apai/ans,6))

Submission status: Accepted

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

Submission status: Accepted

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

stock = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    n = int(input())
    a =  list(map(int, input().split()))
    total = 0.0
    for i in range(n):
        total += (1.0 / a[i])
    print(1.0/total) 

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

import sys
import re

n = int(input())
a = list(map(lambda n: 1/int(n), input().split()))

print(1/sum(a))

Submission status: Accepted

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

s = 1
for x in a:
  s *= x

t = 0
for x in a:
  t += s / x

print("{:.5f}".format(s / t))

Submission status: Accepted

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

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

print(1/sum(A_))

Submission status: Accepted

Solution code:
N=int(input())

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

Submission status: Accepted

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

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

print(1/sum(a))

Submission status: Accepted

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

print(1/ans)

Submission status: Accepted

Solution code:
from fractions import gcd
from functools import reduce
N=int(input())
A=list(map(int,input().split()))
def lcm_base(x, y):
    return (x * y) // gcd(x, y)
def lcm(*num):
  return reduce(lcm_base, num, 1)
c=0
for i in range(N):
  X=lcm(*A)
  if X>c:
    c=X
under=c
over=0
for a in A:
  over+=c//a
print(under/over)

Submission status: Accepted

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

Submission status: Accepted

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

import numpy as np
print(np.reciprocal(sum(np.reciprocal(np.array(A)))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import Fraction

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

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

bunshi = num.numerator
bunbo = num.denominator

ans = bunbo / bunshi
print('{:05f}'.format(ans))

Submission status: Accepted

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

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:
N = int(input())

A = input().split(" ") 

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

Submission status: Accepted

Solution code:
N = int(input())
v = list(map(int, input().split()))
rev = []

for i in range(N):
  rev.append(1/v[i])
  
print(1/sum(rev))

Submission status: Accepted

Solution code:
#import pysnooper
import os,re,sys,operator,math,heapq,string
from collections import Counter,deque
from operator import itemgetter
from itertools import accumulate,combinations,groupby
from sys import stdin,setrecursionlimit
from copy import deepcopy

setrecursionlimit(10**6)

n=int(stdin.readline().rstrip())
a=[int(i) for i in stdin.readline().rstrip().split()]
cnt=0
for i in range(n):
    cnt+=1/a[i]
print(1/cnt)

Submission status: Accepted

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

bunbo = max(a_list)
bunshi = 0

for a in a_list:
    bunshi += (bunbo/a)

print(bunbo/bunshi)

Submission status: Accepted

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

def mul_sum(list):
    mulsum = 0
    for i in range(len(list)):
        tmp = list[:]
        tmp.pop(i)
        mulsum = mulsum + mul(tmp)
    return(mulsum)


def mul(list):
    mul = 1
    for i in range(len(list)):
        mul = mul*list[i]
    return(mul)


print(mul(a_n)/mul_sum(a_n))

Submission status: Accepted

Solution code:
from fractions import gcd

def lcm(x, y):
    return (x * y) // gcd(x, y)

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

l=1
for a in A:
	l=lcm(l,a)

x=0
for a in A:
	x+=l/a
	
print float(l)/x

Submission status: Accepted

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

print(1 / S)

Submission status: Accepted

Solution code:
def main() -> None:
    N = int(input())
    A = [int(a) for a in input().split()]
    sum = 0
    
    for i in range(N):
        sum += 1.0/A[i]
        
    print(1.0/sum)
        
main()

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0.00000

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

print(1/ans)

Submission status: Accepted

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

for AN in A:
    ans += 1 / AN

print(1 / ans)

Submission status: Accepted

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

print(X/num)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import fractions
n = int(input())
a = list(map(int,input().split()))
a.sort()
if n==1:
    print(*a)
else:
    s = a[0]
    for i in range(1,n):
        s = s * a[i] / fractions.gcd(s, a[i])
    ans = 0
    for i in a:
        ans += s/i
    print(s/ans)

Submission status: Accepted

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

a = A[0]
for i in range(1, N):
    a = a * A[i] // fractions.gcd(a, A[i])
saikou = a

A = [saikou * 1.0 / i for i in A]
print(1.0 * saikou / sum(A))

Submission status: Accepted

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

Submission status: Accepted

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

rev_sum = 0
for a in A[::-1]:
    rev_sum += 1 / a

print(1/rev_sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

numerator = 0

for a in A:
    numerator += 1 / a

print(1 / numerator)

Submission status: Accepted

Solution code:
import fractions
n = int(input())
a = list(map(int, input().split()))
lcm = 1
for i in a:
    lcm = lcm * i // fractions.gcd(lcm, i)
t = 0
for i in a:
    t += lcm / i
print(lcm / t)

Submission status: Accepted

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

print(1/m)

Submission status: Accepted

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

a=sum(l)
ans=1/a

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

ans = 1/b
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
l = [int(i) for i in input().split()]
l2 = []
for i in l:
    l2.append(1 / i)

print(1 / sum(l2))

Submission status: Accepted

Solution code:
from heapq import heappush, heappop
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations
import sys
import bisect
import string
sys.setrecursionlimit(10**6)
def SI():
    return input().split()
def MI():
    return map(int,input().split())
def I():
    return int(input())
def LI():
    return [int(i) for i in input().split()]
YN=['Yes','No']
mo=10**9+7

n=I()
a=LI()
ans=0
while a:
    ans+=1/(a.pop())
print(1/ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

a.sort()

su = 0

a = np.array(a)

one = np.array([1]*n)

su = one/a
su = su.tolist()
su = sum(su)

print('%.6f' %(1/su))

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 = int(input())
A = list(map(int, input().split())) 
ans1=0
b=0
while b<N:
    ans1=ans1+1/A[b]
    b=b+1
else:
    ans2=1/ans1
    print(ans2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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


print(float(1/ans))

Submission status: Accepted

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

Res = 0.0
for v in V:
	Res += 1.0/v

print(1.0/Res)

Submission status: Accepted

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

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

Submission status: Accepted

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

    # print(a)
    num = 0
    for r in a:
        # print(r)
        num += 1/int(r)
    print(1/num)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
A_list = [int(i) for i in input().split(" ")]
ans = 0
for i in range(N):
    ans += 1 / A_list[i]
print(1 / ans)

Submission status: Accepted

Solution code:
N = int(input())
# map(int,input().split())
A = list(map(int,input().split()))
# [list(map(int,input().split())) for i in range(N)]
sum = 1.0
bunbo = 0.0
for i in A:
    sum *= i

for j in A:
    bunbo += sum/j

print(sum/bunbo)

Submission status: Accepted

Solution code:

N = int(input())

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

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

print(1/tmp)

Submission status: Accepted

Solution code:
n = int(input())

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

sum = 1/sum

print(str(sum))

Submission status: Accepted

Solution code:
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def lcm(x, y):
    return (x * y) // gcd(x, y)


n = int(input())
temp = 1
ans = 0
a = list(map(int, input().split()))
for i in a:
    temp = lcm(temp, i)

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

print(temp/ans)

Submission status: Accepted

Solution code:
n = int(input())

index = 0
nums = list(map(int,input().split()))

# print('{} {}'.format(n,nums))


child_sum = 0.0
while index < n:
    child_sum = child_sum + 1/nums[index]
    index = index + 1


print('{}'.format(1/child_sum))

Submission status: Accepted

Solution code:
N = int(input())						# 5
A = [int(i) for i in input().split()]			# 1 2 3 4 5 ...

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

print(1/ans)

Submission status: Accepted

Solution code:
import numpy as np

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
def acinput():
    return list(map(int,input().split(" ")))

N=int(input())
a=acinput()

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

print(1/res)

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:
import sys
from fractions import Fraction
input = sys.stdin.readline


def main():
    N = int(input())
    A = list(map(lambda x: Fraction(1, int(x)), input().split()))

    print(float(1 / sum(A)))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num=int(input())
a_array=list(map(int,input().split()))
allmul=1
for a in a_array:
    allmul*=a
denominator=0
for a in a_array:
    denominator+=allmul//a
print(allmul/denominator)

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())

a = list(map(int,input().split()))
a = np.array(a, dtype="float")
a = np.reciprocal(a)

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

Submission status: Accepted

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

result = 0

for i in alist:
  result += 1/i

result = 1 / result

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(open(0))
for i in a:
    s = i.replace('\n','')
    txt = s.split(' ')

res = 0
for i in txt:
    res += 1/int(i)

print(1/res)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
LIST = lambda: list(map(int, INPUT().split()))

sys.setrecursionlimit(10 ** 9)


def main():
    N = INT()
    A = LIST()
    InvA = []

    for i in range(N):
        InvA.append(1/A[i])

    print(1/sum(InvA))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(1 / ans)

Submission status: Accepted

Solution code:
N = int(input()) # 数字を変数に格納
List = list(map(int,input().split())) # 複数の数字をリストに格納

total = 1
sum = 0

for i in range(N):
    total = total * List[i]

l = []
for i in range(N):
    l.append(total / List[i])
    
for i in range(N):
    sum = sum + l[i]
    
result = total / sum

print(result)

Submission status: Accepted

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

lis = list(map(lambda x: 1/x ,lis))

sum = 0
for i in range(n):
    sum += lis[i]

print(1/sum)

Submission status: Accepted

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

for i in range(n):
	a[i] = 1 / int(a[i])
	
ans = 1 / sum(a)

print(ans)

Submission status: Accepted

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

for i in range(N):
  d += 1/l[i]

print(1/d)

Submission status: Accepted

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

# input
n = int(input())
numbers = map(int, input().split())

rev = []
for i in numbers:
    rev.append(1 / float(i))

revsum = 0
for i in range(n):
    revsum = revsum + rev[i]

print(1/revsum)

Submission status: Accepted

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

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

aaa = []
for i in numbers:
    b = Fraction(1,i)
    aaa.append(b)

ans = inverse(sum(aaa))

print(float(ans))

Submission status: Accepted

Solution code:
def gyakusuu(x):
  return 1 / x

y = int(input())
z = [int(x) for x in input().split()]
a = [gyakusuu(i) for i in z]
sum1 = 0
for i in range(y):
  sum1 += a[i]
print(gyakusuu(sum1))

Submission status: Accepted

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

bunbo=0

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

ans=1/bunbo

print(ans)

Submission status: Accepted

Solution code:
a = int(input())
b = list(map(int, input().split()))
sum = 0

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

Submission status: Accepted

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

import functools
import operator

mul = functools.reduce(operator.mul, l)
mm = 0
for i in range(len(l)):
  mm += mul/l[i]
res=mul/mm
print(res)

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

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

print(1/b)

Submission status: Accepted

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

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

res = 1 / res

print(res)

Submission status: Accepted

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

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

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

print(1 / sum)

Submission status: Accepted

Solution code:
a=int(input())
l=list(map(int,input().split()))
s=0
for i in range(len(l)):
    s+=l[i]**-1
print(s**(-1))

Submission status: Accepted

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

Submission status: Accepted

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

def reciprocal(n):
    return 1 / n

rec_A = list(map(reciprocal, A))

print(1 / sum(rec_A))

Submission status: Accepted

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

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())
a=list(map(int,input().split()))
k=1
for i in range(n):
    k*=a[i]
b_li=[]
for i in range(n):
    b=k//a[i]
    b_li.append(b)
print(k/sum(b_li))

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n):
    b.append(1 / a[i])

c = sum(b)
print(1 / c)

Submission status: Accepted

Solution code:
n = input()
a = input().split(' ')

denom = 0
for i in a:
    denom += (1 / int(i))

print(1 / denom)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(float(1 / sum([1/i for i in s])))

Submission status: Accepted

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

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

Submission status: Accepted

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


def solve(N, A):
    ans = 1.0 / sum([1.0 / n for n in A])
    return ans


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

    ans = solve(N, A)

    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
n = int(input())
a = [int(x) for x in stdin.readline().rstrip().split()]

sum1 = 0


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

print(1/sum1)

Submission status: Accepted

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

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

print(1/ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import deque
import heapq
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
a = IL()

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

print(1/num)

Submission status: Accepted

Solution code:
N = int(input())

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

for i in range(N):
  number[i] = 1/number[i]

ans = 1/sum(number)

print(ans)

Submission status: Accepted

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

print(1/Ans)

Submission status: Accepted

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

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

print(1 / output)

Submission status: Accepted

Solution code:
from fractions import Fraction

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

# print(N)
# print(A_list)

sum = 0
for a in A_list:
    sum = sum + Fraction(1, a)


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

Submission status: Accepted

Solution code:
from fractions import Fraction

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

total = Fraction(1, A[0])
for i in A[1:]:
    total += Fraction(1, i)

print(float(1 / total))

Submission status: Accepted

Solution code:
import fractions

N = int(input())
A = list(map(int, input().split()))
b = 0
for a in A:
    b += fractions.Fraction(1, a)
print(float(fractions.Fraction(1, b)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# your code goes here
n=int(input())
l=[int(x) for x in input().split()]
m=1
su=0
for i in l:
	m*=i
for i in l:
	su+=(m//i)
ans=1
for i in l:
	ans=(ans*i)
print(ans/su)

Submission status: Accepted

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

bunbo = 0
bunshi = 1
for i in range(N):
    tmp = 1
    for j in range(N):
        if i == j:
            continue
        else:
            tmp *= A[j]
    bunbo += tmp
    bunshi *= A[i]
    
print(bunshi/bunbo)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())

n_list = list(map(float,input().split()))

ans = 0

for i in n_list:
	ans += np.reciprocal(i)

print(np.reciprocal(ans))

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

print(1/sum)