No.746 Multiples of 7
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もしくは右上の雲マークをクリックしてアカウントを作成してください。