#2895. Odds of Oddness

0

Odds of Oddness

Odds of Oddness

题目描述

给定一个整数 NN。
Takahashi 以相等的概率从不大于 NN 的正整数中选择一个整数 aa。
求 aa 为奇数的概率。

输入格式

输入按以下格式从标准输入给出:
NN

输出格式

输出 aa 为奇数的概率。
当你的输出与裁判的输出的绝对或相对误差至多为 10−610^{-6} 时,将被视为正确。

4
0.5000000000
5
0.6000000000
1
1.0000000000

提示

1≤N≤1001 \leq N \leq 100不大于 44 的正整数有四个:11、22、33 和 44。其中奇数有两个:11 和 33。因此,答案是 24=0.5\frac{2}{4} = 0.5。

标签: AtCoder|abc142A

来源

AtCoder|abc142A