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

Submission status: Accepted

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

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:
num = float(input())
num2 = int((num+1)/2)

print(num2/num)

Submission status: Accepted

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

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

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==1):
  print("1.000000")
  exit()
if(n%2==0):
  print("0.500000")
  exit()
print((n//2+1)/n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
print("{0:.10f}".format(np.ceil(N/2) / N))

Submission status: Accepted

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

def main():
    N  = int(input())
    count = 0
    for i in range(1,N+1):
        if i%2 == 1: count += 1
    print(count/N)
        
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# S = input()
# A,B = map(input().split())
N = int(input())

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

Submission status: Accepted

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

def main():
    N = int(input())

    print('{:.10f}'.format(((N+1)//2)/N))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

n = int(input())

ret = math.ceil(n/2)/n

print(ret)

Submission status: Accepted

Solution code:
N = int(input())

count = 0

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

print(count/N)

Submission status: Accepted

Solution code:
import math

N = int(input())

if N % 2 == 0:
    print('0.5', end='')
else:
    print(math.ceil(N/2) / N, end='')

Submission status: Accepted

Solution code:
n = int(input())
print(1 - (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:
n = int(input())

a = 0
b = 0

if n%2 == 0:
		a = n/2
		b = n/2
else:
		b = int(n/2)
		a = n-b

print(a/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:
N = int(input())
print(1 - (N // 2) / N)

Submission status: Accepted

Solution code:
n=int(input())

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

print(p)

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:
from collections import Counter, defaultdict
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline
from math import factorial
import heapq, bisect
import math
import itertools


import queue
from collections import deque



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






if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

L = list(range(1,N+1))

od = 0
for i in L:
    if i%2 == 1:
        od += 1

print(od/N)

Submission status: Accepted

Solution code:
A = int(input())
k = 0
for i in range(A):
		if (i + 1) % 2 != 0:
				k += 1

print(k / A)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)

def main():
    n=int(input())
    if n%2:
        n2=n//2
        print((n2+1)/n)
    else:
        print(0.5)

main()

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:
import sys
input = sys.stdin.readline
n = int(input())
if n%2 == 0:
  a = 1/2
  print(a)
else:
  a = ((n-1)//2 + 1)/n
  print(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:
def solve():
    n = int(input())
    if n % 2 == 0:
        return(0.5)
    else:
        return((n//2+1)/n)
    

if __name__ == '__main__':
    print(solve())

Submission status: Accepted

Solution code:
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline



def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [int(input_raw[0])]
    print float((N / 2) + (N % 2)) / float(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:
n = int(input())
if n % 2 == 0:
    print(0.5)
else:
    print(float((n + 1) / (2 * n)))

Submission status: Accepted

Solution code:
N = int(input())
# result = [ int(x) for x in input().split()]

num_odd = N // 2 + N % 2

print(num_odd / N)

Submission status: Accepted

Solution code:
N = int(input())
ans = float(0)
d = int(0)

if N%2==1:
    d = N//2 +1
else:
    d = N//2

ans = d/N

print(ans)

Submission status: Accepted

Solution code:
def main():
    n=int(input())
    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())

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

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

list = list(i for i in range(1,n+1))

even = 0
odd = 0

for i in range(n):
  if list[i] % 2 == 0:
    even +=1
  else:
    odd += 1

print(odd / (even + odd))

Submission status: Accepted

Solution code:
N = int(input())

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(1/2)
else:
    print((n-(n//2))/n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

N = int(input())

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 - ((N-1)//2))/N)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

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

Submission status: Accepted

Solution code:
# A - Odds of Oddness
N = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())

even = n//2
odd = n//2 if n%2==0 else n//2+1

print(odd/(even+odd))

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

A = list(range(1, N+1))[1::2]
B = list(range(1, N+1))[0::2]

#print(B)
print(len(B)/N)

Submission status: Accepted

Solution code:
N=int(input())
k=N//2+N%2
g=N//2
#print(k,g)
print(k/(k+g))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ceil((n/2))/n)

Submission status: Accepted

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

N = int(input())

count = 0

for _ in range(1, N + 1, 2):
    count += 1

print(count / 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)
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+1)/2)/N)

Submission status: Accepted

Solution code:
N = int(input())

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

cnt = 0

for i in lst:
  if i %2 != 0:
    cnt += 1

print(cnt/N)

Submission status: Accepted

Solution code:
import sys

n = int(sys.stdin.readline())
odd =0
for i in range(1, n+1):
    if i %2 ==1:
        odd +=1
print(odd/n)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# abc142/abc142_a
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    N = i2n()
    print(1-N//2/N)
    return

main()

Submission status: Accepted

Solution code:
A = int(input())

print(((A + 1) // 2) / A)

Submission status: Accepted

Solution code:
def main():
  n = int(raw_input())
  ods = 0.0
  for x in xrange(n+1):
    if x % 2 > 0:
      ods += 1.0
  print(ods/n)

main()

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

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 == 1:
    print(1)
    exit(0)

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
n=int(input())
print((n-n//2)/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)

elif n % 2 == 0:
    print(0.5)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
import sys
input = sys.stdin.readline
#-------------------------------------

n = int(input())
print( (n-n//2) / n )

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

print(len([i for i in range(1, N+1) if i % 2 != 0]) / N)

Submission status: Accepted

Solution code:
N = int(input())


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

print(odd / N)

Submission status: Accepted

Solution code:
N = int(input())

a = N // 2 + N % 2

print(a / N)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())
if(N%2==0):
    print(0.5)
else:
    print(math.ceil(N/2)/N)

Submission status: Accepted

Solution code:
N = int(input())

mynum = 0

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

print(mynum/N)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

kisu = math.ceil((N / 2))
print(kisu / N)

Submission status: Accepted

Solution code:

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

main()

Submission status: Accepted

Solution code:
N = int(input())

ans = 0



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

print(ans/N)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

odd = ceil(N/2)
print(odd/N)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

import math

if N%2 == 0:
    print(0.5)
else:
    print(math.ceil(N/2)/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.5)
else:
    print(float((n//2 + 1) / n))

Submission status: Accepted

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

import numpy as np

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

    print(even/n)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

def readInts():
  return [int(s) for s in input().split(" ")]

def main():
  N = readInts()[0]

  print(((N - 1) // 2 + 1) / 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:
num = int(input())
odd_num = num // 2 + num % 2
print(odd_num / num)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    if N&1:
        odd = (N // 2) + 1
    else:
        odd = N // 2
    print(odd/N)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys,queue,copy
sys.setrecursionlimit(10**8)
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N = int(input())

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

print(num/N)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# from math import factorial
# from collections import defaultdict, deque
#  from heapq import heappush, heappop, heapify

# A, B = [int(i) for i in input().split(" ")]
# A = int(input())
# As = [int(i) for i in input().split(" ")]
# Ss = ["".join(sorted(input())) for _ in range(N)]
# edges = defaultdict(list)
# for _ in range(N - 1):
#     a, b = [int(i) for i in input().split(" ")]
#     edges[a-1].append(b-1)

N = int(input())
odds = [i for i in range(1, N + 1) if i % 2 == 1]
print(len(odds) / 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((int(N/2)+1)/N)

Submission status: Accepted

Solution code:
# coding: utf-8

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

Submission status: Accepted

Solution code:
def main():
    import math
    n = int(input())
    print(math.ceil(n/2.0)/n)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#import sys

#input = sys.stdin.readline

#import heapq

def main():
#    h,w,a,b = map(int, input().split())
    n = int(input())
    if n%2==0:
        print("0.5")
    else:
        print((1/n)*(n//2+1))

#    for i in range(h):
#            print(aaa)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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:
def main():
    N = int(input())
    tmp = 0
    for i in range(1, N + 1):
        if i % 2 == 1:
            tmp += 1

    print(tmp/N)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

n = float(raw_input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """4"""
        output = """0.5000000000"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """5"""
        output = """0.6000000000"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """1"""
        output = """1.0000000000"""
        self.assertIO(input, output)
def resolve():
    n=int(input())
    if n%2==0:
        print(0.5)
    else:
        print((int(n/2)+1)/n)
if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline())

odd = (N+1)//2
print(odd/N)

Submission status: Accepted

Solution code:
N = int(input())
a = N//2
print((N-a)/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:
N = int(input())
print((N//2 + N % 2)/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:
import math
N = float(input())
if (N % 2 == 0):
    print(0.5)
else:
    print(math.ceil(N / 2) / N)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

if n % 2 == 0:
    print(0.5)
else:
    print(len([i for i in range(1, n+1) if i % 2 == 1]) / n)

Submission status: Accepted

Solution code:
N = int(input())

print( int((N+1)/2)/N )

Submission status: Accepted

Solution code:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools, os, pdb
sys.setrecursionlimit(10**7)
from queue import PriorityQueue
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)
def perr(s): return print(s, file=sys.stderr)

N = _I()
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:
  k = (n+1)//2
  print(k/n)
else:
  k = n//2
  print(k/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:
from sys import stdin

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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


# Generated by 1.1.4 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:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

N = int(input())

ans = 0
for n in range(1, N + 1):
    ans += n % 2
print("{:.12f}".format(ans / N))

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
import numpy as np


# noinspection PyShadowingBuiltinsInspection

def main():
    n = int(input())
    if n % 2 == 0:
        print(0.5)
    else:
        m = (n + 1) / 2
        print(m / n)
    return


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# coding: utf-8

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:
import math
n = int(input())
print(math.ceil(n/2) / n)

Submission status: Accepted

Solution code:
import math

n = int(input())

num = math.ceil(n / 2)

print(num / n)

Submission status: Accepted

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())
if n == 1:
    print(1)
elif n%2 == 0:
    print(0.5)
else:
    print(1-(n//2)/n)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return sys.stdin.readline().strip()
INF = 10 ** 18
MOD = 10 ** 9 + 7

debug = True
#debug = False

def dprint(*objects):
    if debug == True:
        print(*objects)

def solve():
    N = II()
    if N == 1:
        print(1)
        return

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

solve()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from __future__ import division
def main():
    N = int(input())
    print(1 - ((N // 2) / N))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1000000000)
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())

def main():
    N = ii()
    print(((N+1)//2)/N)


main()

Submission status: Accepted

Solution code:
n=int(input())

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())
kicount = 0
gucount = 0
for i in range(1, N + 1):
    if i % 2 == 0:
        gucount += 1
    else:
        kicount += 1

print(kicount / (gucount + kicount))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
words = lambda t : list(map(t, input().split()))
n = int(input())

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