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:
    print("0.5")
else:
    print(((N+1)/2)/N)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
import math
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math as M
MOD=10**9+7
import random
#####################################
k=int(input())
if k%2==0:
    print("{:.10f}".format(1/2))
else:
    print("{:.10f}".format((k//2+1)/k))

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("0.5" if N % 2 == 0 else ((N//2)+1)/N )

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
if N%2==0:
  print('{:.010f}'.format((N//2)/N))
else:
  print('{:.010f}'.format((N//2+1)/N))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))

n = int(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

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

def main():

    N = int(input())

    num = 0

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math
N = int(input())
n_odd = math.ceil(N / 2)

print(n_odd / N)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n=k()
if n == 1:
    print(1)
    sys.exit()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

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

k = int(n/2)
k = n-k
ans = k/n
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

odd_counter = 0
for i in range(1, n + 1):
    if i % 2 == 1:
        odd_counter += 1
print(odd_counter / 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())
ans = -(-n // 2) / n
print(ans)

Submission status: Accepted

Solution code:
# abc142_a.py
# https://atcoder.jp/contests/abc142/tasks/abc142_a

# A - Odds of Oddness /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 100点

# 問題文
# 整数 Nが与えられます。
# 高橋君は、N以下の正整数の中から等確率で 1 つを選んで aとします。
# このとき、aが奇数である確率を答えてください。

# 制約
#     1≤N≤100

# 入力
# 入力は以下の形式で標準入力から与えられる。
# N

# 出力
# aが奇数である確率を出力せよ。 出力は、ジャッジの出力との絶対誤差または相対誤差が 10−6以下のとき正解と判定される。

# 入力例 1
# 4

# 出力例 1
# 0.5000000000

# 4以下の正整数は 1 , 2 , 3 , 4 の 4 つであり、そのうち奇数は 1 , 3 の 2 つです。以上より、答えは 24=0.5です。

# 入力例 2
# 5

# 出力例 2
# 0.6000000000

# 入力例 3
# 1

# 出力例 3
# 1.0000000000


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    # S = lines[0]
    N = int(lines[0])
    # N, M = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(N):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(N):
    #     valueses.append(list(map(int, lines[i+1].split())))

    result = (-(N//-2)) / N

    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['4']
        lines_export = [0.5000000000]
    if pattern == 2:
        lines_input = ['5']
        lines_export = [0.6000000000]
    if pattern == 3:
        lines_input = ['1']
        lines_export = [1.0000000000]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Accepted

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

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools


#sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]

N = int(input())
ans = 0

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

print(ans/N)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

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

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:
t = 1
# t = input()
# t = int(t)
def max(a,b):
	if a > b:
		return a
	return b
while t > 0:
	t -= 1
	n = input()
	n =int(n)
	ans = 0.5
	if n%2 == 1:
		# print("a")
		ans = (n//2 + 1.0)/(n*1.0)
	print(ans)
	# n,x = map(int,input().strip().split())
	# v = list(map(int,input().strip().split()))[0:n]
	# m = {}
	# for i in v:
	# 	temp = x/i
	# 	if(x%i != 0):
	# 		temp += 1
	# 	m[i] += 1
	# ans = 0
	# rem = 0

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
print(len(range(1,N+1,2))/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())
q, r = divmod(N, 2)
print((q + r) / N)

Submission status: Accepted

Solution code:
import math
import sys
N=int(input())
sum=0
if N==1:
    print(1)
    sys.exit()
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((n//2)/n)
else:
  print(((n//2)+1)/n)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

if not ( 1 <= N <= 100 ):sys.exit()

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

Submission status: Accepted

Solution code:
import math

n = int(input())

print(math.ceil(n/2)/n)

Submission status: Accepted

Solution code:
def odd(num):
	return num//2+num%2

N=int(input())

num = odd(N)/N
print("{:.10f}".format(num))

Submission status: Accepted

Solution code:
N = float(input())
S = N
count = 0
while (N > 0):
  if N % 2 != 0:
    count += 1
  N = N - 1
print(count / S)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    N = int(input())
    print((N//2+1)/N if N%2==1 else 0.5)
    
if '__main__' == __name__:
    resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
nn = []
odd = 0
for i in range(1, n+1):
    if i % 2 == 1:
        odd += 1
    nn.append(i)
s = len(nn)
print(odd/s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

if n % 2 == 0:
  print("{:.9f}".format(0.5))

else:
  print("{:.9f}".format((n + 1) // 2 / 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/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:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
n = int(input())
a=n//2+(n%2)
print(a/n)

Submission status: Accepted

Solution code:
n = int(input())
odd = n//2 + n%2
print(odd/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:
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())

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

odd = []

for j in range(N+1):
  if L[j] % 2 == 0:
    pass
  else:
    odd.append(L[j])
  j+=1

print(len(odd)/(len(L)-1))

Submission status: Accepted

Solution code:
n = int(input())

m = range(1,n + 1)

a = range(1,n + 1,2)

b = len(a) / len(m)
print(b)

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(odd/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

def I(): return int(sys.stdin.readline().rstrip())

N = I()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Coding is about expressing your feeling, and
# there is always a better way to express your feeling_feelme
import sys
import math
# sys.stdin=open('input.txt','r')
# sys.stdout=open('output2.txt','w')
from sys import stdin,stdout
from collections import deque,defaultdict
from math import ceil,floor,inf,sqrt,factorial,gcd,log2
from copy import deepcopy
ii1=lambda:int(stdin.readline().strip())
is1=lambda:stdin.readline().strip()
iia=lambda:list(map(int,stdin.readline().strip().split()))
isa=lambda:stdin.readline().strip().split()
mod=int(1e9 + 7)

n=ii1()
if n==1:
    print(1)
elif n%2==0:
    print(1/2)
else:
    print((n//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())
if n==0:
	p=0
	print("%.9f"%p)
elif n&1:
	p=(n//2)+1
	print("%.9f"%(p/n))
else:
	p=n//2
	print("%.9f"%(p/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())
ans = (N - (N//2)) / N
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
n=int(input())
a=0
for i in range(n,0,-1):
  if i%2:
    a+=1
    
print(a/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())
c=0
for i in range(1,n+1):
  if i%2!=0:
    c+=1 
print("{0:.10f}".format(c/n))

Submission status: Accepted

Solution code:
# from collections import Counter
# n = int(input())
# li = list(map(int, input().split()))
# a, b = map(int, input().split())
# a = int(input())
n = int(input())
odd = (n+1)//2
even = n//2
print(odd/(odd+even))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
count = 0
result = 0
for i in range(n+1):
  if i % 2 == 0:
    pass
  else:
    count +=1

result = count / n

print(result)

Submission status: Accepted

Solution code:
N = int(input())
count = 0
for i in range(1,N+1):
  if i % 2 == 1:
    count += 1
  else:
    pass
print(count/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:
s = int(input())
print((s-s//2)/s)

Submission status: Accepted

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

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(read())

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

print(odd/N)

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

N = int(sys.stdin.readline())
print((N + 1) // 2 / N)

Submission status: Accepted

Solution code:
N = int(input())

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

elif 2<=N and N%2 != 0:
    print(((N+1)//2)/N)

else:
    print("1.00000")

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
odds = (n+1)//2
print(odds/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 == 0:
    print(f'{(n/2) / n:.10f}')
else:
    print(f'{(n//2 + 1) / n:.10f}')

Submission status: Accepted

Solution code:
n = int(input())
odd = []
even = []
for i in range(1, n+1):
  if i%2 == 0:
    even.append(i)
  else:
    odd.append(i)
print(len(odd)/n)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
oddCount = len(list(filter(lambda x: x % 2 == 1, range(1,n + 1))))
print(oddCount / n)

Submission status: Accepted

Solution code:
import math

n=int(input())

print(math.ceil(n/2)/n)

Submission status: Accepted

Solution code:
import sys


# input = sys.stdin.readline

def main():
    N = int(input())
    eve = int(N//2)
    print((N-eve)/N)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n=int(input())
a=0
for i in range(1,n+1):
  a+=(i%2)
print(a/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:
"""
    こんにちは。これはクシャルです
    
    Author : thekushalghosh (クシャル)
    Team   : CodeDiggers
 
    I prefer Python language over the C++ language :p :D
        
    Visit my website : thekushalghosh.github.io
"""
import sys,math,cmath,time
start_time = time.time()
##########################################################################
################# ---- THE ACTUAL CODE STARTS BELOW ---- #################

def solve():
    n = inp()
    print(0.5 if n % 2 == 0 else 1 - ((n // 2) / n))
            
################## ---- THE ACTUAL CODE ENDS ABOVE ---- ##################
##########################################################################
 
def main():
    global tt
    if not ONLINE_JUDGE:
        sys.stdin = open("input.txt","r")
        sys.stdout = open("output.txt","w")
    t = 1
    for tt in range(t):
        solve()
    if not ONLINE_JUDGE:
        print("Time Elapsed :",time.time() - start_time,"seconds")
        sys.stdout.close()
    
#---------------------- USER DEFINED INPUT FUNCTIONS ----------------------#
def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    return(input().strip())
def invr():
    return(map(int,input().split()))
 
#------------------ USER DEFINED PROGRAMMING FUNCTIONS ------------------#
def counter(a):
    q = [0] * max(a)
    for i in range(len(a)):
        q[a[i] - 1] = q[a[i] - 1],1
    return(q)
 
def string_counter(a):
    q = [0] * 26
    for i in range(len(a)):
        q[ord(a[i]) - 97] = q[ord(a[i]) - 97],1
    return(q)

def factors(n):
    q = []
    for i in range(1,int(n ** 0.5) + 1):
        if n % i == 0: q.append(i); q.append(n // i)
    return(list(sorted(list(set(q)))))

def prime_factors(n):
    q = []
    while n % 2 == 0: q.append(2); n = n // 2
    for i in range(3,int(n ** 0.5) + 1,2):
        while n % i == 0: q.append(i); n = n // i
    if n > 2: q.append(n)
    return(list(sorted(q)))

#-----------------------------------------------------------------------#
        
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
    input = sys.stdin.readline
main()

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:
N=int(input())
if N%2==0:
  print('{:.10f}'.format(0.5))
else:
  print('{:.10f}'.format((N+1)/(2*N)))

Submission status: Accepted

Solution code:
N=int(input())
if N==1:
  print('{:.10f}'.format(1))
elif N%2==0:
  print('{:.10f}'.format(0.5))
else:
  print('{:.10f}'.format((N+1)/(2*N)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n=int(input())
print((n-n//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:
def yn(yn):
    if yn:
        print("Yes")
    else:
        print("No")


a = input()

a = int(a)

print(((a + 1) // 2) / a)

Submission status: Accepted

Solution code:
import math

N = int(input())

if N % 2 == 0:
    ans = 0.5
else :
    ans = math.ceil(N / 2) / N

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

n = int(input())

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N = int(readline())
    ans = (N + 1) // 2 / N
    print(ans)
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

print((n+1)//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:
n=int(input())
k=[i for i in range(1,n+1,2)]
print(len(k)/n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
print('{:.8f}'.format((N + 1) // 2 / N))

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    # 奇数の数
    m = n - (n // 2)
    ans = m / n
    print(ans)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
s=[i for i in range(1,n+1)]
sum=0
for i in range(n):
  if s[i]%2!=0:
    sum=sum+1
print(sum/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())
li=[i for i in range(1,n+1) if i%2==1]
s=len(li)
print(s/n)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())

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

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:
inp1 = int(input())
x=(inp1 - (inp1 // 2)) / inp1
print(float(x))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
# 142 A

n = int(input())
odd = 0

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

x = odd/n
print('%.10f' % x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# A - Odds of Oddness
def main():
    cnt = 0
    n = int(input())
    for i in range(1,n+1):
        if i % 2 != 0:
            cnt += 1
    print(cnt/n)

if __name__ ==  "__main__":
    main()

Submission status: Accepted

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