AtCoder Beginner Contest 142
翻译中…
Problem Statement
翻译中…
Given is an integer $N$.
翻译中…
Takahashi chooses an integer $a$ from the positive integers not greater than $N$ with equal probability.
翻译中…
Find the probability that $a$ is odd.
翻译中…
Constraints
翻译中…
$1 \leq N \leq 100$
翻译中…
Input
翻译中…
Input is given from Standard Input in the following format:
翻译中…
N
翻译中…
Output
翻译中…
Print the probability that $a$ is odd. Your output will be considered correct when its absolute or relative error from the judge's output is at most $10^{-6}$.
翻译中…
样例
Input #1
4
Output #1
0.5000000000
There are four positive integers not greater than $4$: $1$, $2$, $3$, and $4$. Among them, we have two odd numbers: $1$ and $3$. Thus, the answer is $\frac{2}{4} = 0.5$.
Input #2
5
Output #2
0.6000000000
Input #3
1
Output #3
1.0000000000
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。