x = gets.to_f a = -1 b = 2**2 c = 1123 d = 21460 g = 2 h = 99 i = 1103 j = 26390 k = 1 l = 882 def nPk(n, k) (n - k + 1 .. n).inject(1.0, :*) / (1 .. k).inject(1.0, :*) end def fact(n) Math.gamma(n + 1) end N = 4 N1 = N N2 = N seq1 = (0..N1).sum { |n| (a**n * fact(b) * nPk(b * n, [0, b * n - d.gcd(l)**2].max) * (c + d * n)) / (l**(n + k) * (49 * b * h / 22.0)**n * ((2**2)**n * fact(n))**b) } seq2 = (Math.sqrt(g**3 / h.to_f**g**g) * (0..N2).sum { |n| (fact(b * n) * (i + j * n)) / ((22.0 * l / 49)**n * fact(n))**b })**a puts x * seq1 * seq2