Problem:


Score : 100 points

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}.

Sample Input 1

4

Sample 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.

Sample Input 2

5

Sample Output 2

0.6000000000

Sample Input 3

1

Sample Output 3

1.0000000000



Sample input:
4


Sample output:
0.5000000000

Submission status: Accepted

Solution code:
import numpy as np
N=int(input())

if N%2==0:
    print(1/2)
else:
    print((N+1)/2/N)

Submission status: Accepted

Solution code:
N=int(input())
oddnum=N//2+N%2
print(oddnum/N)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    if n%2 == 0:
        print(((n/2)/n))
    else:
        print(((n+1)/2)/n)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
no=int(input())
n=no
c=0
while(n>0):
  if n%2 == 1:
    c += 1
  n -= 1
print(c/no)

Submission status: Accepted

Solution code:
N = int(input())
if N%2==0:
    a =(N/2)/N
    print(a)
else:
    b=((N+1)/2)/N
    print(b)

Submission status: Accepted

Solution code:
N = int(input())

if(N%2==1):
  od = int(N/2)+1
else:
  od = N/2
  
print(od/N)

Submission status: Accepted

Solution code:
N=int(input())

if N%2==0:
  print(1/2)
else:
  print((N//2+1)/N)

Submission status: Accepted

Solution code:
N = int(input())

count = 0
for i in range(1, N + 1):
    if i % 2 == 1:
        count += 1

print(count/N)

Submission status: Accepted

Solution code:
a = int(input())
if a ==1:
    print(1)
elif a%2 ==0:
    print(0.5)
else:
    proportion =((a-1)/2+1)/a
    print(proportion)

Submission status: Accepted

Solution code:
N = int(input())

print( 1.0 - N // 2 / N)

Submission status: Accepted

Solution code:
n = int(input())
if n == 1:
    print(1)
elif n % 2 == 0:
    print(0.5)
else:
    print((n+1)/(2*n))

Submission status: Accepted

Solution code:
input_line=input().rstrip()
kisuu=0
for number in range(1,int(input_line)+1):
  if number%2==1:
    kisuu=kisuu+1
possi=kisuu/int(input_line)
print(possi)

Submission status: Accepted

Solution code:
n = int(input())
ki = 0
for i in range(1,n+1):
  if i %2 == 1:
    ki += 1
print(ki/n)

Submission status: Accepted

Solution code:
b = int(input())
a = 0

for i in range(1, b + 1):
    if i % 2 != 0:
        a += 1
        
print(a / b)

Submission status: Accepted

Solution code:
N = int(input())
q , mod = divmod(N , 2)
if(mod==0):
	print(0.5)
else:
	print((q + mod) / N)

Submission status: Accepted

Solution code:
n=int(input())
if n%2==0:
  print(1/2)
else:
  print((n+1)/2/n)

Submission status: Accepted

Solution code:
n = int(input())

if(n%2==0):
	ans = 1/2
else:
	ans = (n//2+1)/n
	
print(ans)

Submission status: Accepted

Solution code:
number = int(input())
if number % 2 == 0:
  print((number/2)/number)
else:
  print(((number+1)/2)/number)

Submission status: Accepted

Solution code:
N = int(input())
ans = N//2
ans = 1.0 - ans/N
print(ans)

Submission status: Accepted

Solution code:
#ABC142 A - Odds of Oddness

N = int(input())
count = 0

for i in range(1,N+1):
    if (i % 2) != 0:
        count += 1

print('{:.10f}'.format(count/N))

Submission status: Accepted

Solution code:
N = int(input())
if N % 2 == 0:
    Ans = (N/2)/N
else:
    Ans = (N+1)/(2*N)
print(Ans)

Submission status: Accepted

Solution code:
a = int(input())

if a % 2 == 1:
  b = a // 2 + 1
else:
  b = a / 2
  
print(b / a)

Submission status: Accepted

Solution code:
n = int(input())
if(n%2==0):
  print(0.5)
else:
  print((n+1)/(2*n))

Submission status: Accepted

Solution code:
n = int(input())
k = 0
g = 0
for i in range(1 ,n + 1):
    if i % 2:
        k += 1.00000
    else:
        g += 1.00000
ans = k / (g + k)
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
print(0.5 if N%2==0 else 0.5+1/2/N)

Submission status: Accepted

Solution code:
a=int(input())
if a%2==0:
	b=a/2
else:
	b=a//2+1
print(b/a)

Submission status: Accepted

Solution code:
n = int(input())

cou = 0
for i in range(1,n+1):
    if i%2 != 0:
        cou += 1

print(cou/n)

Submission status: Accepted

Solution code:
N = int (input ())

a = ((N + 1) // 2) / N

print (a)

Submission status: Accepted

Solution code:
a=int(input())
if a%2==0:
  print(float(1/2))
else:
  print(float((a+1)/(2*a)))

Submission status: Accepted

Solution code:
import math
n = int(input())
b = (math.ceil(n/2))
print(b/n)

Submission status: Accepted

Solution code:
import random

N = int(input())

if N % 2 == 0:
  print(0.5)
else:
  print(((N+1)/2)/N)

Submission status: Accepted

Solution code:
N = int(input())
if N%2==0:
    result = (N//2)/N
else:
    result = ((N//2)+1)/N
print(float(result))

Submission status: Accepted

Solution code:
N = int(input())

if N%2 == 0:
  print(1/2)
elif N%2 == 1:
  print(((N//2)+1)/N)

Submission status: Accepted

Solution code:
def filter_odd(x):
    return x % 2 == 1


def solve(N):
    odd_list = list(
        filter(filter_odd, range(1, N + 1)[::-1])
    )
    return len(odd_list) / N


N = int(input())

print(solve(N))

Submission status: Accepted

Solution code:
n=int(input())

print((n//2+n%2)/n)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
 
a = float(input())
 
gusu = a / 2
ngusu = a // 2
 
if gusu > ngusu:
  kisu = ngusu + 1
else:
  kisu = ngusu
kaku = kisu / a 

print(kaku)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
import math
 
a = float(input())
 
gusu = a / 2
ngusu = math.floor(gusu)
 
if gusu > ngusu:
  kisu = ngusu + 1
else:
  kisu = ngusu
kaku = kisu / a 

print(kaku)

Submission status: Accepted

Solution code:
import math
n = int(input())
print(math.ceil(n/2)/n)


# 入力
'''
## スペース区切りの数字の受け取り
a = int(input())
a,b,c.. = map(int,input().split())
## 改行で区切られたn個の数字の受け取り
n = int(input())
a = [int(input()) for _ in range(n)]

n,k,x,y = [int(input()) for _ in [0]*4];print(x*k+y*(n-k) if n > k else x*n)

## 切り上げ


'''

Submission status: Accepted

Solution code:
def solve(N):
    odd_count = 0

    for x in range(1, N + 1)[::-1]:
        if x % 2 == 1:
            odd_count += 1

    if N == 1:
        return 1

    return odd_count / N


N = int(input())

print(solve(N))

Submission status: Accepted

Solution code:
N = int(input())
if N == 1:
  print(1)
elif N % 2 == 0:
  print(1/2)
else:
  print((1+1/N)/2)

Submission status: Accepted

Solution code:
N = int(input())

print("{0:.10f}".format((N // 2 + N % 2) / N))

Submission status: Accepted

Solution code:
N = int(input())

nums = [x for x in range(1,N+1)]
odds = [x for x in nums if x%2 == 1]
proba = len(odds)/len(nums)
print(proba)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
import math

N=int(input())
if N%2==0:
    print(0.5)
else:
    print((N//2+1)/N)

Submission status: Accepted

Solution code:
n = int(input())

counter = 0

for i in range(1,n+1):
    if i%2==1:
        counter+=1

print(counter/n)

Submission status: Accepted

Solution code:
n = int(input())
if n%2 == 0:
    print(0.5)
else:
    print((int(n/2)+1)/n)

Submission status: Accepted

Solution code:
N=int(input())
cnt = 0
for i in range(1, N+1):
  if i % 2 != 0:
    cnt+=1
print(cnt/N)

Submission status: Accepted

Solution code:
N = int(input())
print(float(N // 2 + N % 2) / N)

Submission status: Accepted

Solution code:
import copy

def j(n):
    if n:print("yes")
    else:print("no")
    exit(0)
rem = 10 ** 9 + 7

"""
def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")
"""

def ip():
    return int(input())
def iprow():
    return [int(i) for i in input().split()]
def ips():
    return (int(i) for i in input().split())
def ipmultiplerow(n):
    a = []
    for i in range(n):
        a.append(ip())
    return a
def printrow(a):
    for i in a:
        print(i)

n = ip()
if n%2:
    a = n//2+1
else:
    a = n//2
print(a/n)

Submission status: Accepted

Solution code:
N=int(input())
if N%2==0:
  print(0.5)
else:
  print(1.0*(N//2+1)/N)

Submission status: Accepted

Solution code:
N = int(input())
if(N%2 == 0):
    print((N//2)/N)
else:
    print(((N//2)+1)/N)

Submission status: Accepted

Solution code:
n = int(input())
print('{:.10f}'.format((n//2 + n%2)/n))

Submission status: Accepted

Solution code:
N=int(input())
print(len([n for n in range(1,N+1) if n%2!=0])/N)

Submission status: Accepted

Solution code:
n = int(input())
count = 0
for i in range(1, n + 1):
    if i % 2 != 0:
        count += 1
print(count / i)

Submission status: Accepted

Solution code:
N = int(input())
odd = 0
for i in range(0, N+1, 1):
    if i % 2 == 0:
        continue
    elif i % 2 == 1:
        odd += 1
print(float(odd/N))

Submission status: Accepted

Solution code:
n = int(input())
odd = n - int(n/2)
print("{}".format(odd/n))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np

N = int(input())

if N % 2 == 0:
    ans = 0.5
else:
    ans = (N - N // 2) / N

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
count = 0
for i in range(1,n+1):
  if i%2 == 1:
    count += 1
    
print(count/n)

Submission status: Accepted

Solution code:
n = int(input())
x = 1 if n==1 else((n//2+1)/n if n%2!=0 else 0.5)
print(x)

Submission status: Accepted

Solution code:
N = int(input())
if N % 2 == 0:
    print(1/2)
else:
    print(((N + 1) / 2) / N)

Submission status: Accepted

Solution code:
n = int(input())

if n%2==0:
  print(0.5)
else:
  answer = (int(n/2)+1)/n
  print(answer)

Submission status: Accepted

Solution code:
#数値が一つの場合の入力
n = int(input())
#2で割り切れれば偶数
#個数カウント
cnt = n // 2
#偶数の確立
ans = (n // 2) / n
#1から偶数の確立を引けば奇数の確立
print(1 - ans)

Submission status: Accepted

Solution code:
n = int(input())

print((n // 2 + n % 2) / n)

Submission status: Accepted

Solution code:
N = int(input())
if N%2==0:
    print(N/2/N)
else:
    print((N+1)/2/N)

Submission status: Accepted

Solution code:
a = int(input())

print("{:.10f}".format(((a + 1) // 2 ) / a))

Submission status: Accepted

Solution code:
import sys
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split()) 
DBG = True # and False

def ddprint(x):
  if DBG:
    print(x)

n = inn()
print(((n+1)//2)/n)

Submission status: Accepted

Solution code:
n = int(raw_input())
print 0.5 if n % 2 == 0 else (n/2 + 1)/float(n)

Submission status: Accepted

Solution code:
import sys,os,math
from collections import Counter, defaultdict, deque
import bisect
from sys import stdin, stdout
from itertools import repeat


# sys.stdin = open('input')
# n, k = map(int, raw_input().split())
# da = map(int, raw_input().split())
# db = map(int, raw_input().split())


def solve():

    pass

def main():
    n = map(int, raw_input().split())[0]
    print (n+1)/2/float(n)


main()

Submission status: Accepted

Solution code:
N = int(input())
print((N//2 + N%2)/N)

Submission status: Accepted

Solution code:
N = int(input())
odds = [i for i in range(1, N + 1) if i % 2 != 0]
print("{}".format(len(odds) / N))

Submission status: Accepted

Solution code:
N = float(input())
o = float( N / 2 / N )
e = float( (N / 2 + 0.5 ) / N )
if N == 1:
    print(1)
elif N % 2 ==0:
    print(o)
elif N % 2 ==1:
    print(e)

Submission status: Accepted

Solution code:
N = int(input())

if N % 2 == 0:
    print(1/2)
else:
    print((N//2+1)/N)

Submission status: Accepted

Solution code:
import math
n=int(input())

if n%2==1:
  print((math.floor(n/2)+1)/n)
  
if n%2!=1:
  print((n/2)/n)

Submission status: Accepted

Solution code:
n = int(input())

if n % 2 == 0:
  a = (n / 2) / n
  print(format(a, ".10f"))
else:
  b = (((n - 1) / 2) + 1) / n
  print(format(b, ".10f"))

Submission status: Accepted

Solution code:
n = int(input())
if n == 1:
    print(1)
elif n%2 == 0:
    print(0.5)
else:
    p = (n+1)/(2*n)
    print(p)

Submission status: Accepted

Solution code:
N=int(input())
if N%2==0:
  answer = 1.0/2
else:
  answer = ((N-1)/2 + 1) /N
print(answer)

Submission status: Accepted

Solution code:
N = int(input())
odd_num = -(-N//2)
print(odd_num/N)

Submission status: Accepted

Solution code:
n = int(input())
if n%2 is 0:
    print(0.5)
else:
    a = (n-1)/2+1
    print(a/n)

Submission status: Accepted

Solution code:
n=int(input())
odd=n//2 if n%2==0 else (n+1)//2
print(odd/n)

Submission status: Accepted

Solution code:
# 入力を1つの数値として扱う
s = int(input())

# 数値以下の正整数の数のうち、奇数であるものの数
odd = int(s / 2) + (s % 2)

# 確率
ans = odd / s

# 答えの出力
print( ans )

Submission status: Accepted

Solution code:
n = int(input())
if n%2==0:
  print(0.5)
else:
  a = (n+1)//2
  print(a/n)

Submission status: Accepted

Solution code:
N = float(input())
if N == 1:
  ans = 1
else:
  flg = N % 2
  if flg == 0:
    ans = 0.5
  else:
    ans = (N + 1) / N / 2
    
print(ans)

Submission status: Accepted

Solution code:
def main():
  n = int(input())
  if n%2==0:
    print(0.5)
  else:
    print(float((n+1)/2/n))

if __name__ == "__main__":
  main()

Submission status: Accepted

Solution code:
import sys
import math

n = input()
n = float(n)
ans = (n - math.floor(n / 2))
ans = float(ans / n)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

kisu = 0
gusu = 0

for i in range(1,N+1):
  if i % 2 == 1:
    kisu += 1
  else:
    gusu += 1
    
kakuritsu = kisu / (gusu + kisu)

print('{:.10f}'.format(kakuritsu))

Submission status: Accepted

Solution code:
N = int(input())

kisu = 0

for i in range(1, N+1):
  if i % 2 == 1:
    kisu += 1
    
    
kakuritsu = kisu / N


print('{:.10f}'.format(kakuritsu))

Submission status: Accepted

Solution code:
n=int(input())
c=0
for i in range(1,n+1):
  if i%2!=0:
    c+=1
print(c/n)

Submission status: Accepted

Solution code:
import sys
import math

n = input()
n = float(n)
ans = (n - n / 2)
ans = math.ceil(ans)
ans = float(ans / n)
print(ans)

Submission status: Accepted

Solution code:
import math


def t(n):
    return math.ceil(n / 2) / n


if __name__ == "__main__":
    print(t(int(input())))

Submission status: Accepted

Solution code:
n=-1*int(input())
print( (n//2) / n)

Submission status: Accepted

Solution code:
N = int(input())
ans = (N / 2)/N
ans1 = (N / 2 + 0.5)/N
if N % 2 == 0:
	print(ans)
else:
    print(ans1)

Submission status: Accepted

Solution code:
N = int(input())
A = N - N//2
print(A/N)

Submission status: Accepted

Solution code:
N = int(input())

count = 0
for num in range(N+1):
  if num % 2:
    count += 1

print(count/N)

Submission status: Accepted

Solution code:
n = int(input())
w = -(-n // 2)
ans = w/n
print(ans)

Submission status: Accepted

Solution code:

N=int(input())

if (N%2==1):
  p = (N+1)/(2*N)
else:
  p = N/(2*N)
  
print(p)

Submission status: Accepted

Solution code:
num = int(input())

count = 0

for i in range(1, num+1, 1):
    if i % 2 == 1:
       count += 1


print(count / num)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

_n = int(input())

if _n % 2 == 0:
    print(1 / 2)
else:
    print(1 / 2 + 1 / (2 * _n))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# %%

import sys


def solve(N: int):
    return (N+1)//2/N


# %%

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
# (tips: You use the default template now. You can remove this line by using your custom template)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    print(solve(N))


if __name__ == '__main__':
    main()


# %%

Submission status: Accepted

Solution code:
n = int(input())
if n%2 == 0:
    print(0.5)
else:
    print(0.5+1/(2*n))

Submission status: Accepted

Solution code:
n=int(input())
print(1-((n//2)/n))

Submission status: Accepted

Solution code:
N = input()
n = int(N)
result = -(-n//2)/n
print(result)

Submission status: Accepted

Solution code:
N = int(input())
x = N // 2
print ( 1- (x/N))

Submission status: Accepted

Solution code:
n = int(input())
result = 0
m = n % 2
if m == 0:
  result = 0.5
else:
  result = ((n-1)/2 + 1)/n
print (result)

Submission status: Accepted

Solution code:
N = int(input())

print(1-(N//2)/N)

Submission status: Accepted

Solution code:
x = int(input())
print(1 - x//2/x)

Submission status: Accepted

Solution code:
x = int(input())
e = x // 2
print((1-e/x))

Submission status: Accepted

Solution code:
n = int(input())
p = 0
for i in range(n+1):
    if i % 2 == 1:
        p += 1
print('{:.10}'.format(p/n))

Submission status: Accepted

Solution code:
n = int(input())
count = 0
for i in range(1, n + 1):
    if i % 2 == 1:
        count += 1
print("{:.10f}".format(count / n))

Submission status: Accepted

Solution code:
N = int(input())
print(((N + 1) //2) / N)

Submission status: Accepted

Solution code:
num = int(input())

if num % 2 == 0:
	print(num // 2 / num)
else:
	print((num // 2 + 1) / num)

Submission status: Accepted

Solution code:
s = float(input())
if (s % 2 == 0):
  print (s/(2*s))
else:
  print ((s+1)/(2*s))

Submission status: Accepted

Solution code:
N = int(input())
n = 0

for i in range(N):
	if i % 2 is 0 :
		n += 1

print(n / N)

Submission status: Accepted

Solution code:
N = int(input())
ret = -(-N // 2) / N
print(ret)

Submission status: Accepted

Solution code:
N = int(input())
if(N % 2 == 0):
    ret = (N // 2) / N
else:
    ret = ((N // 2) + 1) / N
print(ret)

Submission status: Accepted

Solution code:
n = int(input())
ans = ((n-1)//2 + 1)/n
print(ans)

Submission status: Accepted

Solution code:
import sys

N = int(sys.stdin.readline())

if N % 2 == 0:
  a = 1 / 2
else:
  a = (N+1) / (2 * N)

print('%.10f' %a)

Submission status: Accepted

Solution code:
n = int(input())
if n % 2 == 0:
  print(0.5)
else:
  print((n // 2 + 1) / n)

Submission status: Accepted

Solution code:
N = int(input())

if N % 2 == 0:
  print(0.5)
else:
  print(0.5 + 1/(2*N))

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    print((n - n // 2) / n)


if __name__ == '__main__':
    slove()

Submission status: Accepted

Solution code:
a=int(input())
s=1-(a//2)/a
print(s)

Submission status: Accepted

Solution code:
N = int(input())
oddc = 0
for i in range(N+1):
    if i % 2 == 1:
        oddc += 1
ans = oddc / N
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
if N % 2 == 0:
    print(1/2)
else:
    M = N//2
    print((N-M)/N)

Submission status: Accepted

Solution code:
# coding: utf-8
n = int(input())
l = [i for i in range(n + 1) if i % 2 == 1]
print(len(l) / n)

Submission status: Accepted

Solution code:
N = int(input())
odds = len([i+1 for i in range(N)][0::2])
print(odds/N)

Submission status: Accepted

Solution code:
str_input = int(input())
print((str_input-int(str_input/2))/str_input)

Submission status: Accepted

Solution code:
N = int(input())
if N%2 == 0:
    print((N / 2) / N)
else:
    print(((N + 1) / 2) / N)

Submission status: Accepted

Solution code:
n = input()
n = int(n)
if n % 2 == 0:
  print(0.5)
else:
  print((n+1)/(2*n))

Submission status: Accepted

Solution code:
N = int(input())
if N%2==0:
  print(1/2)
else:
  print((N//2+1)/N)

Submission status: Accepted

Solution code:
import math

n = int(input())
print(math.ceil(n/2)/n)

Submission status: Accepted

Solution code:
n = int(input())
total = len(range(1,n+1))
if n % 2 == 0:
    mol = n // 2
else:
    mol = (n // 2) + 1
print(mol/total)

Submission status: Accepted

Solution code:
N = int(input())

if N == 1:
    print(N)

elif N % 2 == 1:
    n = int(N / 2) + 1
    print(n/N)
else:
    n = N / 2
    print(n/N)

Submission status: Accepted

Solution code:
N = int(input())

if N == 1:
    print(float(N))

elif N % 2 == 1:
    n = int(N / 2) + 1
    print(float(n/N))
else:
    n = N / 2
    print(float(n/N))

Submission status: Accepted

Solution code:
import math
n = int(input())
if n%2 == 0:
  print(1/2)
else:
  print(math.ceil(n/2)/n)

Submission status: Accepted

Solution code:
n = int(input())

if n % 2 == 0:
  print(1/2)
else:
  mid = n // 2
  print((mid + 1) / n)

Submission status: Accepted

Solution code:
N = int(input())
if N % 2 ==0:
  ans = 0.5
else:
  ans = (N+1)/(2*N)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
print(((N%2)+(N//2))/N)

Submission status: Accepted

Solution code:
N = int(input())

cnt = 0.
for i in range(1,N+1):
    if i%2 != 0:
        cnt += 1

print(cnt / N)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    n = II()
    ans = 0
    for i in range(1, n + 1):
        ans += i & 1
    print(ans/n)
    return

#B
def B():
    n, k = LI()
    h = LI()
    ans = 0
    for i in h:
        ans += i >= k
    print(ans)
    return

#C
def C():
    n = II()
    a = LI()
    d = defaultdict(int)
    for i in range(n):
        d[a[i] + 1] = i + 1
    for _, v in sorted(d.items()):
        print(v, end=" ")
    print()
    return

def primes(n):
    """ Input n>=6, Returns a list of primes, 2 <= p < n """
    """ 6以上の数であれば p (素数) <= n のlistを返す """
    n, correction = n-n%6+6, 2-(n%6>1)
    sieve = [True] * (n//3)
    for i in range(1,int(n**0.5)//3+1):
        if sieve[i]:
            k=3*i+1|1
            sieve[      k*k//3      ::2*k] = [False] * ((n//6-k*k//6-1)//k+1)
            sieve[k*(k-2*(i&1)+4)//3::2*k] = [False] * ((n//6-k*(k-2*(i&1)+4)//6-1)//k+1)
    return [2,3] + [3*i+1|1 for i in range(1,n//3-correction) if sieve[i]]

#D
def D():
    a, b = LI()
    p = primes(int(math.sqrt(max(a, b))) + 1)
    ans = 1
    for i in p:
        if a % i == b % i == 0:
            ans += 1
    print(ans)
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    A()

Submission status: Accepted

Solution code:
N = int(input())
if N == 1:
    print(float(1))
elif N%2 == 0:
    print(float(1/2))
else:
    print(float((N//2+1)/N))

Submission status: Accepted

Solution code:
N = int(input())
prob = -(-N//2)/N

print('{:.6f}'.format(prob))

Submission status: Accepted

Solution code:
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

N = int(input())

if N%2==0:
    odd_count = N//2
else:
    odd_count = N//2+1
print('{:.10f}'.format(odd_count/N))

Submission status: Accepted

Solution code:
n = int(input())
odd = (n+1) // 2
ans = odd / n
print(ans)

Submission status: Accepted

Solution code:
import math

N = int(input())

#Nが偶数
def prob_even(N):
    return 1/2
  
#Nが奇数
def prob_odd(N):
    return math.ceil(N/2)/N
  
if N%2 == 0:
    ans = prob_even(N)
else:
    ans = prob_odd(N)
    
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
odds = 0
for i in range(n):
    if ((i + 1) % 2 == 1):
        odds += 1
print(odds / n)

Submission status: Accepted

Solution code:
N = int(input())

if N%2==0:
    print(int(N/2)/N)
else:
    print((int(N/2) + 1)/N)

Submission status: Accepted

Solution code:
n=int(input())

if n==1:
    ans=1
elif n%2==0:
    ans=(n/2)/n
else:
    ans=((n+1)/2)/n

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

odd = [x for x in range(1,N+1,2)]
all = [x for x in range(1,N+1)]
print(len(odd)/len(all))

Submission status: Accepted

Solution code:
import math
n=int(input())

print((n - math.floor(n/2))/n)

Submission status: Accepted

Solution code:
N = int(input())

n = (N+1)//2

print(n/N)

Submission status: Accepted

Solution code:
N = int(input())
print(((N+1)//2)/float(N))

Submission status: Accepted

Solution code:
N = int(input())
if(N%2 == 0):
	print(0.5)
else:
	print(((N+1)/2)/float(N))

Submission status: Accepted

Solution code:
N = int(input())
if N %2 == 0 :
    print(0.5)
else :
    print((N + 1)/(N * 2))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""ABC142.ipynb

Automatically generated by Colaboratory.

Original file is located at
    https://colab.research.google.com/drive/1a5aajQRjVtRR5jXaooVlLtRM2WBIS2cv
"""

N=int(input())

def EO(x):
  if x % 2 == 0:
    return "Even"
  return "Odd"

if EO(N)=="Even":
  prob=0.5
else:
  prob=(int(N/2)+1)/N
print(prob)

Submission status: Accepted

Solution code:
N = int(input())
if N == 1:
    ans = 1
else:
    if N % 2 == 0:
        ans = 0.5
    else:
        ans = ((N // 2) + 1) / N
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

if n % 2 == 0:
	print(0.5)
else:
	print((n//2 + 1) / n)

Submission status: Accepted

Solution code:
N = int(input())

odd = 0
even = 0
for i in range(N):
	if i % 2 == 0:
		odd += 1
	else:
		even += 1

print(odd/(odd + even))

Submission status: Accepted

Solution code:
N = int(input())
answer = (N // 2 if N % 2 == 0 else N // 2 + 1) / N

print(answer)

Submission status: Accepted

Solution code:
N = int(input())
if N % 2 == 0:
  print(1/2)
else:
  print((N//2+1) / N)

Submission status: Accepted

Solution code:
import math

N = int(input())

if N % 2 == 0:
    print('0.5000000000')
else:
    n = math.ceil(N/2)
    print('{:.8f}'.format(n/N))

Submission status: Accepted

Solution code:
n = int(input())
cnt = 0
for i in range(1, n + 1):
    if i%2 != 0:
        cnt += 1
    else: 
        cnt+=0
print("{:.10f}".format(cnt/n))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-                                                                      

n = int(input())
oddnum = 0 

for i in range(1,n+1):
  if i % 2 == 1:
    oddnum += 1

print(oddnum/n)

Submission status: Accepted

Solution code:
import math
N = int(input())

if N % 2 == 0:
    print(0.5)
else:
    print((math.floor(N / 2) + 1)/N)

Submission status: Accepted

Solution code:
n = int(input())


if n % 2 == 0:
    print(0.5)
else:
    print((n//2 + 1)/n)

Submission status: Accepted

Solution code:
N = int(input())

print((N // 2 + N % 2) / N)

Submission status: Accepted

Solution code:
N = int(input())
if(N == 1):
  print(1)
elif(N %2 == 0):
  print(0.5)
elif(N %2 == 1):
  print((N+1)/(2*N))

Submission status: Accepted

Solution code:
N = int(input())

if N == 1:
    print(1)
elif N % 2 == 0:
    print(0.5)
else:
    print((N+1)/(2*N))

Submission status: Accepted

Solution code:
n = int(input())
if n % 2 == 0:
    a = n // 2
else:
    a = n // 2 + 1

print(a/n)

Submission status: Accepted

Solution code:
n = int(input())

print(0.5 if n %2 ==0 else (n-n//2)/n)

Submission status: Accepted

Solution code:
n = int(input())
ans = (n - int(n/2))/n
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
if N%2 == 0:
  print(1/2)
else:
  a = N - N//2
  print(a/N)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import math

def solve(N: int):
    odd = math.floor(N / 2) if not N % 2 else math.floor(N / 2) + 1
    print("{0:.10f}".format(odd / N))
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import math
input = sys.stdin.readline

N = int(input())

if N%2 == 0:
    print(1/2)
else:
    print(math.ceil(N/2)/N)

Submission status: Accepted

Solution code:
a = int(input())
if a%2 == 0:
  print(1/2)
else:
  print((a//2+1)/a)

Submission status: Accepted

Solution code:
import math

n = int(input())

if(n % 2 == 1):
    print(math.ceil(n / 2) / n)
else:
    print(1 / 2)

Submission status: Accepted

Solution code:
n = int(input())
sum = 0
for i in range(1, n + 1):
    if i % 2 == 1:
        sum += 1
print(sum / n)

Submission status: Accepted

Solution code:
N = int(input())
if N % 2 == 0:
    print(1 / 2)
else:
    print((N - (((N + 1) / 2) -1)) / N)

Submission status: Accepted

Solution code:
n=int(input())
odd=0
for i in range(1,n+1):
  if i%2==1:
    odd+=1
print(odd/n)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
if N%2 == 0:
    print("0.5")
else:
    print((N//2+1)/N)

Submission status: Accepted

Solution code:
N = int(input())

even = N // 2
odd = N - even

ans = odd / N

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
if n%2==0:
  print((n/2)/n)
else:
  print((((n-1)/2)+1)/n)

Submission status: Accepted

Solution code:
def solve():
  n = int(input())
  total_numbers = [int(i) for i in range(1, n+1)]
  odd_numbers = total_numbers[0::2]  
  result = float(len(odd_numbers)/len(total_numbers))
  print('{:.10f}'.format(result))


if __name__ == '__main__':
  solve()

Submission status: Accepted

Solution code:
N=int(input())
if N%2==0:
    print(0.5)
else:
    print(((N//2)+1)/N)

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc142/tasks/abc142_a
n = int(input())
print((n-n//2)/n)

Submission status: Accepted

Solution code:
inputN = input()
inputN = int(inputN)
Odd = 0
for n in range(inputN):
    if n%2 == 1:
        Odd += 1
print((inputN-Odd)/inputN)

Submission status: Accepted

Solution code:
N = int(input())
print((N-(N//2))/N)