問題一覧 > 通常問題

No.746 Multiples of 7

レベル : / AI推定難易度 : 208 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 277
作問者 : ミドリムシ / テスター : ciel
お気に入りにしたユーザー ProblemId : 2229 / 自分の提出
問題文最終更新日: 2018-09-05 22:55:56
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. Back to the original
yukicoder contest 202 (順位表) の他の問題:

Problem Statement

Find the proportion of multiples of $7$ among the integers between $1$ and $10^N$, inclusive.

Input

$N$

$0 \leq N \leq 10^{5}$

Output

Output the answer on $1$ line, followed by a newline.

Sample

Sample 1
Input
0
Output
0

Among the integers between $1$ and $10^0=1$, inclusive, the number of multiples of $7$ is $0$, so the proportion is $\frac{0}{1}=0$.

Sample 2
Input
4
Output
0.1428

Among the integers between $1$ and $10^4=10000$, inclusive, the number of multiples of $7$ is $1428$, so the proportion is $\frac{1428}{10000}=0.1428$.

Sample 3
Input
100
Output
0.1428571428571428571428571428571428571428571428571428571428571428571428571428571428571428571428571428

Among the integers between $1$ and $10^{100}=10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000$, inclusive, the number of multiples of $7$ is $1428571428571428571428571428571428571428571428571428571428571428571428571428571428571428571428571428$, so the proportion is $\frac{1428571428571428571428571428571428571428571428571428571428571428571428571428571428571428571428571428}{10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000}=0.1428571428571428571428571428571428571428571428571428571428571428571428571428571428571428571428571428$.

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