問題一覧 > 通常問題

No.1271 初めての級数

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 小数誤差許容問題 絶対誤差または相対誤差が $10^{-6}$ 以下。ただし、ジャッジ側の都合で500桁未満にしてください
タグ : (AC するまで非表示) / 解いたユーザー数 238
作問者 : 👑 qand / テスター : 57tggx
お気に入りにしたユーザー ProblemId : 5238 / 自分の提出
問題文最終更新日: 2021-05-08 01:05:07
My First Series
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Show the original
yukicoder contest 272 (Weird math contest) (順位表) の他の問題:

Problem Statement

Kamitori-san was given the following problem at school.

$         \displaystyle \sum_{n=1}^{\infty} \frac{1}{n(n+k)}$を求めてください。

However, Kamitori-san cannot solve this problem. Please solve it in place of Kamitori-san.

It is guaranteed that this series converges within the specified range.

Input

$k$

  • All inputs are integers.
  • $0 \le k \le 10^2$
  • Output

    Print a newline at the end. Also, make sure that at least one of the absolute error and the relative error is at most $10^{-6}$.

    [Added at 21:24] Output the value of this infinite series.

    Sample

    Sample 1
    Input
    1
    Output
    1

    Sample 2
    Input
    2
    Output
    0.75

    Sample 3
    Input
    100
    Output
    0.0518737751763962

    提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。