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:
N = int(input())
if N%2==0:
  odd = N/2
else:
  odd =(N-1)/2+1
print(odd/N)

Submission status: Accepted

Solution code:
N=int(input())
N2=N/2
if N%2==1:
  N2=(N-1)/2
print('{:.10f}'.format(1-N2/N))

Submission status: Accepted

Solution code:
def test():
    n = int(input())
    if n%2 != 0:
        print("{:.6f}".format(((n//2)+1)/n))
    else:
        print("{:.6f}".format((n//2)/n))


if __name__ == "__main__":
    test()

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, y = map(int,input().split())
#li = list(map(int, input().split()))

if n == 1:
    print(1)
if n >=2:
    if n%2 == 0:
        print(1/2)
    elif n%2 ==1:
        print((n+1)/(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:
a = int(input())
b = a // 2
if a % 2 == 0:
    print(1/2)
else:
    print(1-(b/a))

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(a/n)

Submission status: Accepted

Solution code:
# yukicoder@python3
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())
if (n % 2 == 0):
  print(0.5)
else:
  print(((n // 2) + 1) / n)

Submission status: Accepted

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

Submission status: Accepted

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

print(x/N)

Submission status: Accepted

Solution code:
N=int(input())

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

Submission status: Accepted

Solution code:
import math
n = int(input())
x = math.ceil(n/2)
print('%.10f'%(x/n))

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
N=int(input())
if N==1:
  print(1)
elif N % 2 == 0:
  print(1/2)
else:
  M=N-(N//2)
  print(M/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 - Odds of Oddness
N = int(input())

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

print(result)

Submission status: Accepted

Solution code:
import sys


def input(): return sys.stdin.readline().strip()


def main():
    N = int(input())
    odds = (N+1) // 2
    print(odds / N)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())

if N % 2 == 0:
    print('0.5000000000')
else:
    print(round((int(N / 2) + 1) / N, 10))

Submission status: Accepted

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


def solve(N: int):
    count = 0

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

    print('{:0<12}'.format(count / N))
    return


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:
N = int(input())

if N % 2 == 0:
    print((N//2)/N)

else:
    print((N//2+1)/N)

Submission status: Accepted

Solution code:
N=float(input());
print(1-((N//2)/N))

Submission status: Accepted

Solution code:
n = int(input())

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

print(ans/n)

Submission status: Accepted

Solution code:
N = int(input())

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

print(odd / N)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    odds = 0

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    n = int(input())
    if 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) :
    print(n/2/n)
else :
    print((n+1)/2/n)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
if N % 2 == 0:
    print((N/2)/N)
else:
    print((((N-1)/2)+1)/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())

b = 0

for i in range(n):
    if (i+1) % 2 != 0:
        b += 1
#c = n-b
print(b/n)

Submission status: Accepted

Solution code:
import numpy as np
N=int(input())
print((N//2+N%2)/N)

Submission status: Accepted

Solution code:
def q_A(N):
	kisuu = 0
	for i in range(N):
		n = i + 1
		if n % 2 == 1:
			kisuu += 1
	density = kisuu / N
	print(density)

#q_A(1)
q_A(int(input()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
a=int(input())
b=sum([1 for a in range(1,a+1,2)])
print(b/a)

Submission status: Accepted

Solution code:
N = int(input())

a = range(1,N+1)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
n = 0
i = 1
while i <= N:
    if i % 2 == 1:
        n += 1
    i += 1
print(n/N)

Submission status: Accepted

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

if N % 2 == 0:
  odd_num = N // 2
else:
  odd_num = N // 2 + 1

print(odd_num / N)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

cnt=0

for i in range(N):
  if i%2==1:
    cnt += 1
print(1-(cnt/N))

Submission status: Accepted

Solution code:
#import pysnooper
#import numpy
#import os,re,sys,operator
#from collections import Counter,deque
#from operator import itemgetter
#from itertools import accumulate,combinations,groupby,combinations_with_replacement,permutations
from sys import stdin,setrecursionlimit
#from copy import deepcopy
#import heapq
#import math
#import string

setrecursionlimit(10**6)
input=stdin.readline

n=int(input().rstrip())
now=0
for i in range(1,n+1):
    if i%2==1:
        now+=1
print(now/n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
mod = N % 2

if N == 1:
    print(1.0000000)
elif mod == 0:
    print(0.500000)
elif mod == 1:
    print((float((N//2)+1)/float(N)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ans = [i for i in range(1,n+1,2)]
print(len(ans)/n)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from functools import reduce


n = int(input())
m = n/2
p = 1./2.
if not m.is_integer():
    p = p + 1/(2*n)
print("{0:.10f}".format(p))

Submission status: Accepted

Solution code:
import math

N = int(input())

a = math.ceil(N/2)
ans = a/N

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

print(count / N)

Submission status: Accepted

Solution code:
n = int(input())

if (n % 2) == 0:
  print("0.5")
elif n == 1:
  print("1.0")
else:
  print(str(((n-1)/2+1)/n))

Submission status: Accepted

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

kisu = 0
gusu = 0

for i in range(a):
    if (i + 1) % 2 == 0:
        gusu += 1
    else:
        kisu += 1

print(kisu / 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())
a=N//2
amari=N%2
if amari==1:
  a=(a+1)/N
else:
  a=a/N
  
print(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())
if n == 1:
    print(1)
elif n % 2 == 0:
    print(0.5)
else:
    print((n//2+1)/n)

Submission status: Accepted

Solution code:
import math

N = int(input())
odds_num = math.ceil(N / 2)
print(odds_num / 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())
if N % 2:
  print((N-N//2)/N)
else:
  print(1/2)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

a = N if N % 2 == 0 else N+1

print((a/2)/N)

Submission status: Accepted

Solution code:
a, = [list(map(int, s.split())) for s in open(0)][0]
if a % 2 == 0:
    print(0.5)
else:
    print((a//2+1)/a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from decimal import *

n = int(input())

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

Submission status: Accepted

Solution code:
num=int(input())
ans=0

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

Submission status: Accepted

Solution code:
N = int(input())

if N == 1:
    print("{0:.10f}".format(1/1))
elif N % 2 == 0:
    print("{0:.10f}".format(1/2))
else:
    print("{0:.10f}".format((N // 2 + 1) / 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:
from collections import defaultdict, deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys
import random
import itertools
import 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')


def A():
    a = II()
    b = a//2
    p = b/a
    if a % 2:
        print(1-p)
    else:
        print(p)

    return

# B


def B():
    s = S()
    for i, si in enumerate(s):
        if i % 2:
            if si == "R":
                print("No")
                return
        else:
            if si == "L":
                print("No")
                return
    print("Yes")
    return

# C


def C():
    n, k, q = LI()
    d = [0] * n
    for _ in range(q):
        a = II() - 1
        d[a] += 1
    for a in d:
        if k - (q - a) > 0:
            print("Yes")
        else:
            print("No")
    return

# D


def D():
    n, = LI()
    a = LI()
    q = []
    for ai in a:
        heappush(q, ai)
    for _ in range(m):
        heappush(q, heappop(q) / 2)
    ans = 0
    while q:
        ans += int(heappop(q))
    print(ans)
    return

# E


def E():
    return

# F


def F():
    return


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

Submission status: Accepted

Solution code:
import math
a=int(input())
s=math.ceil(a/2)
ans=s/a
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''
import math
def main():
    N = int(input())

    odd = (math.ceil(N / 2))
    print("{0:.10f}".format(odd / N))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

     
print(odd/n)

Submission status: Accepted

Solution code:
#l=list(map(int, input().split()))
#n,k=map(int, input().split())
#l=list(map(int, input().split()))
n = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())

nums_list = np.arange(1,N+1)
odd_list = nums_list[nums_list%2==1]
print(len(odd_list)/len(nums_list))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#A
from math import floor
n = int(input())
if n == 1:
    print(1)
elif n % 2 == 0:
    print(0.5)
else:
    print((floor(n/2) + 1)/n)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(int(1e6))

N = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())
ans = -(-N // 2) / N
print("{:.9f}".format(ans))

Submission status: Accepted

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

Submission status: Accepted

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

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:
import numpy as np

N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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


def solve(N: int):
    print(len([i for i in range(1,N+1) if i%2 == 1])/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:
n=int(input())
if n%2==0:
    print(1/2)
elif n%2==1:
    print(((n-1)/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())
if(n%2==0):
  print(0.5)
else:
  print(((n//2)+1)/n)

Submission status: Accepted

Solution code:
n = int(input())

if n == 1:
    print(1.0)
elif 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((N//2)/N)
else:
    print((N//2+1)/N)

Submission status: Accepted

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

Submission status: Accepted

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

print(m.ceil((N/2))/N)

Submission status: Accepted

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


def solve(N: int):
    count = 0
    for i in range(1, N + 1):
        if i % 2 != 0:
            count += 1
        else:
            pass

    result = count / N

    print(result)

    return


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:
n = int(input())
if n%2 == 0:
  print(1/2)
else:
  print((n//2+1)/n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

N = int(readline())


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

Submission status: Accepted

Solution code:
n = int(input())
od = 0
for i in range(n):
  if (i+1) % 2 == 1:
    od += 1
print(od / 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 == 1:
    print(1)
elif n % 2 == 0:
    print(n/2/n)
else:
    print((int(n/2) +1)/ n)

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    N = int(input())
    if N % 2 == 1:
        print(float(N//2 + 1) / N)
        exit()
    else:
        print(float(N//2) / N)
        exit()

Submission status: Accepted

Solution code:

if __name__ == "__main__":
    N = int(input())
    if N == 1:
        print(1/1)
    elif N % 2 == 0:
        print(1/2)
    else:
        print((int(N/2)+1)/N)

Submission status: Accepted

Solution code:
'''
Created on 2019/09/28

@author: oiwaiman
'''

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(1/2)
if N%2==1:
  print(((N+1)/2)/N)

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:
a = int(input())
odd_count = 0
for b in range(a+1):
    if b == 0:
        continue
    if b % 2 == 1:
        odd_count += 1
print('{:.10f}'.format(odd_count/a))  # 小数点以下3位

Submission status: Accepted

Solution code:
# A - Odds of Oddness

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())

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

Submission status: Accepted

Solution code:
N = int(input())

lst = [i for i in range(N+1)]

i = lst[1::2]

print(len(i)/N)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 20 20:47:47 2019

@author: Owner
"""

import numpy as np
import sys
import collections
import scipy.misc
import math
from operator import itemgetter
import itertools
import copy
import bisect
import heapq

#素因数を並べる
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   
# 桁数を吐く
def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

def find_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

class UnionFind(object):
    def __init__(self, n=1):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]
        self.size = [1 for _ in range(n)]

    def find(self, x):
        """
        x が属するグループを探索
        """
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        """
        x と y のグループを結合
        """
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                x, y = y, x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            self.par[y] = x
            self.size[x] += self.size[y]

    def is_same(self, x, y):
        """
        x と y が同じグループか否か
        """
        return self.find(x) == self.find(y)

    def get_size(self, x):
        """
        x が属するグループの要素数
        """
        x = self.find(x)
        return self.size[x]
    

"""
N, X = map(int, input().split())

x = list(map(int, input().split()))

P = [0]*N
Y = [0]*N
for n in range(N):
    P[n], Y[n] = map(int, input().split())

# 多次元配列の宣言（あとでintにすること。）（タプルにすること。）
dp = np.zeros((N+1, 4,4,4))
    
all(nstr.count(c) for c in '753')

# 複数配列を並び替え
ABT = zip(A, B, totAB)
result = 0
# itemgetterには何番目の配列をキーにしたいか渡します
sorted(ABT,key=itemgetter(2))
A, B, totAB = zip(*ABT)
A.sort(reverse=True)

# 2進数のbit判定
(x >> i) & 1

# dp最小化問題
dp = [np.inf]*N
for n in range(N):
    if n == 0:
        dp[n] = 0
    else:
        for k in range(1,K+1):
            if n-k >= 0:
                dp[n] = min(dp[n], dp[n-k] + abs(h[n]-h[n-k]))
            else:
                break
# 累積和
add = 1 # 問題によって決まる
res = 0
sums = [0]*(len(nums)+1)
for i in range(len(nums)):
    sums[i+1] = sums[i] + nums[i]
for i in range(0, len(nums), 2):
    left = i
    right = min(i+add, len(nums))
    tmp = sums[right] - sums[left]
    res = max(tmp, res)

#２分探索
li, ri = bisect.bisect_left(p_ac, l[i]-1), bisect.bisect_right(p_ac, r[i]-1)    

#ソート関数
org_list = [3, 1, 4, 5, 2]
new_list = sorted(org_list)
print(org_list)
print(new_list)
# [3, 1, 4, 5, 2]
# [1, 2, 3, 4, 5]

#Distance Transformation
    for h in range(0,H):
        for w in range(0,W):
            if h == 0 and w == 0:
                pass
            elif h == 0:
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h-1][W-w]+1)
            elif w == 0:   
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h][W-w-1]+1)
            else:
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h][W-w-1]+1, D[H-h-1][W-w]+1, D[H-h][W-w]+2)
            d_max = max(D[H-h-1][W-w-1], d_max)

"""


N=int(input())

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

    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

num = N // 2

if N % 2 == 1:
  num += 1

print( num / N )

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math
N = int(input())

print(math.ceil(N/2.0)/N)

Submission status: Accepted

Solution code:
n = int(input())
odd = []

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

odd_number = len(odd)
p = odd_number / n
print(p)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
n=int(input())
o=n-n//2
print(o/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==1:
  print(1)
elif n%2==0:
  print(0.5)
else:
  print((n+1)/(2*n))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
N = int(input().strip())
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(0.5)
else:
    print(((N-1)/ 2 + 1 )/ N)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
a = int(input())
k=0
for i in range(1,a+1):
    if i%2==1:
        k+=1
print(k/a)

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

n = ni()

print((n-n//2)/n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())



if n% 2 == 0:
    print(0.500000)
elif n == 1:
    print(1.00000)
else:
    l = n // 2 + 1
    print(l/n)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

# input
N = int(input())

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

# output
print(odd / N)

Submission status: Accepted

Solution code:
from math import ceil
N = int(input())
print(ceil(N/2)/N)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())

no=x//2
if(x%2==1):
    no+=1
print(no/x)

Submission status: Accepted

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

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

elif n==1:
    print(1)

else:
    print((math.ceil(n//2)+1)/n)

Submission status: Accepted

Solution code:
import math
def A():
    num = int(input())
    odd_nums = math.ceil(num/2.0)
    print(odd_nums/num)

A()

Submission status: Accepted

Solution code:
N = int(input())

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

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:
a = int(input())
if(a==1):
  print(1/a)
elif(a%2!=0):
  print((a-a//2)/a)
else:
  print(1/2)

Submission status: Accepted

Solution code:
import sys


def main():
    n = int(sys.stdin.readline().strip())
    if n % 2:
        print(((n + 1) // 2) / n)
    else:
        print(0.5)



main()

Submission status: Accepted

Solution code:
n = int(input())
# l = [ x for x in range(1,n+1) ]
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())
if N%2==0:
  print((N/2)/N)
else:
  print(((N//2)+1)/N)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = int(input())
#print(num)
cnt=0
for i in range(1,num+1):
    if i%2==1:
        cnt = cnt+1
    else:
        pass
ans = cnt/num
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def main():
    N = int(input())
    if N % 2 == 0:
        ans = (N/2)/N
    elif N % 2 == 1:
        ans = ((N+1)/2)/N
    print(ans)

if __name__ == '__main__':
    main()