Harryxun/stf_run huggingface dataset:
import sympy

def func(n, history):
    l = sympy.divisors(n)
    if len(l) == 1:
        history.append(l[0])
        return history
    for i in l[1:]:
        if n == i:
            history.append(i)
            return history
        if i in history:
            continue
        history.append(i)
        _ = n // i
        func(_, history)
        break
    return history

N = int(input())
if N == 0:
    print(0)
else:
    h = func(N, [])
    print(len(set(h)))

### FIXED CODE ###

history = set([])

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

def func(n):
    if n == 1:
        return 
    l = make_divisors(n)
    for i in sorted(l[1:]):
        if i in history:
            continue
        if len(factorization(i)) > 1:
            continue
        history.add(i)
        _ = n // i
        func(_)
        break
    return

N = int(input())
if N == 0:
    print(0)
elif N == 1:
    print(0)
else:
    func(N)
    print(len(history))
import sys
sys.setrecursionlimit(10**6)

def dfs(v, u, d):
    if d % 2 == 0:
        even.append(v)
    else:
        odd.append(v)
    for i in g[v]:
        if i == u:
            continue
        dfs(i, v, d + 1)
    return

N = int(input())
g = [[] for _ in range(N)]
odd = []
even =[]
ans = [-1] * N
nums = [[], [], []]
for i in range(1, N + 1):
    nums[i % 3].append(i)
sanlst = []
for i in range(N - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    g[a].append(b)
    g[b].append(a)

dfs(0, 0, 0)
zCnt = len(nums[0])

if len(even) <= zCnt:
    for node in even:
        ans[node] = nums[0].pop()
    rest = nums[0] + nums[1] + nums[2]
    for node in odd:
        ans[node] = rest.pop()
elif len(even) <= zCnt:
    for node in odd:
        ans[node] = nums[0].pop()
    rest = nums[0] + nums[1] + nums[2]
    for node in even:
        ans[node] = rest.pop()
else:
    for i in nums[1]:
        ans[even.pop()] = i
    for i in nums[2]:
        ans[odd.pop()] = i
    rest = nums[0]
    for i in even:
        ans[i] = rest.pop()
    for i in odd:
        ans[i] = rest.pop()

print(*ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

def dfs(v, u, d):
    if d % 2 == 0:
        even.append(v)
    else:
        odd.append(v)
    for i in g[v]:
        if i == u:
            continue
        dfs(i, v, d + 1)
    return

N = int(input())
g = [[] for _ in range(N)]
odd = []
even =[]
ans = [-1] * N
nums = [[], [], []]
for i in range(1, N + 1):
    nums[i % 3].append(i)
sanlst = []
for i in range(N - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    g[a].append(b)
    g[b].append(a)

dfs(0, -1, 0)
zCnt = len(nums[0])

if len(even) <= zCnt:
    for node in even:
        ans[node] = nums[0].pop()
    rest = nums[0] + nums[1] + nums[2]
    for node in odd:
        ans[node] = rest.pop()
elif len(odd) <= zCnt:
    for node in odd:
        ans[node] = nums[0].pop()
    rest = nums[0] + nums[1] + nums[2]
    for node in even:
        ans[node] = rest.pop()
else:
    for i in nums[1]:
        ans[even.pop()] = i
    for i in nums[2]:
        ans[odd.pop()] = i
    rest = nums[0]
    for i in even:
        ans[i] = rest.pop()
    for i in odd:
        ans[i] = rest.pop()

print(*ans)
# B
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))

ans = 0
for i in range(n):
    gain = v[i] - c[i]
    if gain > 0:
        ans += gain
print(ans)

### FIXED CODE ###

# A
a, b, t = map(int, input().split())

count = a
ans = 0
while True:
    if count > t + 0.5:
        break
    count += a
    ans += b
print(ans)
import sys
f = sys.stdin

while True:
    n = int(f.readline())
    if n == 0:
        break
    teams = [f.readline().split() for i in range(n)]
    
    teams = [(t[0], -t.count('0'), t.count('1'), i) for i, t in enumerate(teams)]
    
    teams.sort(key=operator.itemgetter(1,2,3))
    
    print('\n'.join([t[0] for t in teams]))

### FIXED CODE ###

import sys
import operator
f = sys.stdin

while True:
    n = int(f.readline())
    if n == 0:
        break
    teams = [f.readline().split() for i in range(n)]
    
    teams = [(t[0], -t.count('0'), t.count('1'), i) for i, t in enumerate(teams)]
    
    teams.sort(key=operator.itemgetter(1,2,3))
    
    print('\n'.join([t[0] for t in teams]))
import collections

num = int(input())
values = [int(i) for i in input().split()]

odd = []  # kisuu
even = []  # gusu

for n, i in enumerate(values):
    if (n + 1) % 2 == 0:
        even.append(i)
    else:
        odd.append(i)

odd_counts = collections.Counter(odd)
even_counts = collections.Counter(even)

# print(odd_counts.most_common())
# print(even_counts.most_common())

odd_most_common = odd_counts.most_common()
even_most_common = even_counts.most_common()

half_num = int(num / 2)

if odd_most_common[0][0] != even_most_common[0][0]:
    odd_replace_num = half_num - odd_most_common[0][1]
    even_replace_num = half_num - even_most_common[0][1]
    print(odd_replace_num + even_replace_num)
else:
    answers = []
    odd_replace_num = half_num - odd_most_common[0][1]
    if len(even_most_common) == 1:
        even_replace_num = half_num
    else:
        even_replace_num = half_num - even_most_common[1][1]
    answers.append(odd_replace_num + even_replace_num)

    if len(odd_most_common) == 1:
        odd_replace_num = half_num
    else:
        odd_replace_num = half_num - odd_most_common[1][1]
    even_replace_num = half_num - even_most_common[0][1]
    answers.append(odd_replace_num + even_replace_num)

    print(min(answers))


### FIXED CODE ###

n = input()
print(n.replace("1", "x").replace("9", "1").replace("x", "9"))
from math import gcd
n, k = map(int, input().split())
a = list(map(int, input().split()))

x = a[0]
for i in range(1, n):
    x = gcd(x, a[i])

print("POSSIBLE" if k % x == 0 and max(a) >= k else "IMPOSSIBLE")


### FIXED CODE ###

from fractions import gcd
n, k = map(int, input().split())
a = list(map(int, input().split()))

x = a[0]
for i in range(1, n):
    x = gcd(x, a[i])

print("POSSIBLE" if k % x == 0 and max(a) >= k else "IMPOSSIBLE")
h,w=map(int,input().split())
lll=["."*(w+2)]
G=[list("."+input()+".") for _ in range(h)]
G=lll+G+lll
for i in range(1,w+1):
  for j in range(1,h+1):
    if G[i][j]=="#" and G[i-1][j]==G[i+1][j]==G[i][j-1]==G[i][j+1]==".":
      print("No")
      exit()
print("Yes")  

### FIXED CODE ###

h,w=map(int,input().split())
lll=[list("."*(w+2))]
G=[list("."+input()+".") for _ in range(h)]
G=lll+G+lll
#print(G)
for i in range(1,h+1):
  for j in range(1,w+1):
    if G[i][j]=="#" and G[i-1][j]==G[i+1][j]==G[i][j-1]==G[i][j+1]==".":
      print("No")
      exit()
print("Yes")
r_cnt = S.count("R")
g_cnt  = S.count("G")
b_cnt = S.count("B")

ans = r_cnt * g_cnt * b_cnt

for i in range(N):
    for d in range(N):
        j = i + d
        k = j + d
        if k >= N:
            break
        if S[i] != S[j] and S[j] != S[k] and S[i] != S[k]:
            ans -= 1
print(ans)

### FIXED CODE ###

import itertools

N = int(input())
S = input()

r_cnt = S.count("R")
g_cnt  = S.count("G")
b_cnt = S.count("B")

ans = r_cnt * g_cnt * b_cnt

for i in range(N):
    for d in range(N):
        j = i + d
        k = j + d
        if k >= N:
            break
        if S[i] != S[j] and S[j] != S[k] and S[i] != S[k]:
            ans -= 1
print(ans)
import sys

a = sys.argv[1]
b = sys.argv[2]
c = sys.argv[3]

d = a + b +c

if d < 22;
	print("win")
else;
	print("bust")

### FIXED CODE ###

a, b, c= map(int, input().split())
if a+b+c <= 21:
  print("win")
else:
  print("bust")
n,k = map(int,input().split())
if N>=2*K-1:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

n,k = map(int,input().split())
if n>=2*k-1:
  print("YES")
else:
  print("NO")
n = int(input())
s_list = [input() for i in range(n)]
m = int(input())
t_list = [input() for j in range(m)]


def list_diff(list1, list2):
    result = list1.copy()
    for val in list2:
        if val in result:
            result.remove(val)
    return result


def count_max(diff_list):
    cnt_list = [diff_list.count(ele) for ele in set(diff_list)]
    return max(cnt_list)


lst = list_diff(s_list, t_list)
print(count_max(lst))

### FIXED CODE ###

n = int(input())
s_list = [input() for i in range(n)]
m = int(input())
t_list = [input() for j in range(m)]


def list_diff(list1, list2):
    result = list1.copy()
    for val in list2:
        if val in result:
            result.remove(val)
    return result


def count_max(diff_list):
    cnt_list = [diff_list.count(ele) for ele in set(diff_list)]
    if len(cnt_list) != 0:
        return max(cnt_list)
    else:
        return 0


lst = list_diff(s_list, t_list)
print(count_max(lst))
S=input()
N = len(S)
ans=0
for i in range(N+1):
    if i%2==0:
        if S[i]=='L':
            print('No')
        else:
            ans+=1
    else:
        if S[i]=='R':
            print('No')
        else:
            ans+=1
if ans==2:
    print('Yes')

### FIXED CODE ###

S=input()
N = len(S)
S_o=[]
S_e=[]
for i in range(N):
    if i%2==0:
        S_o.append(S[i])
    else:
        S_e.append(S[i])
if 'L' in S_o or 'R' in S_e:
    print('No')
else:
    print('Yes')
from heapq import heapify, heappop, heappush, nlargest, nsmallest
     
     
    N, M, L = map(int, input().split())
     
    G = [list(map(int, input().split())) for _ in range(M)]
    Q = int(input())
    Query = [list(map(int, input().split())) for _ in range(Q)]
     
    nei_graph = [[float('inf')] * N for _ in range(N)]
    for a, b, c in G:
        if c <= L:
            nei_graph[a - 1][b - 1] = c
            nei_graph[b - 1][a - 1] = c
     
    for a, b, c in G:
        nei_graph[a - 1][a - 1] = 0
     
     
    def dijkstra(start_node, end_node, nei_graph):
        visited = set()
     
        nodes = []
        heapify(nodes)
        heappush(nodes, [start_node, 0, L, 0])
     
        dist = [float('inf')] * N
        dist[start_node] = 0
     
        while nodes:
            node, d, remain, cnt = heappop(nodes)
            if node in visited:
                continue
     
            if node == end_node:
                return cnt
     
            visited.add(node)
     
            for i, edge in enumerate(nei_graph[node]):
                if edge == float('inf') or d + edge > dist[i]:
                    continue
     
                dist[i] = d + edge
     
                if remain < edge:
                    new_remain = L - edge
                    new_cnt = cnt + 1
                else:
                    new_remain = remain - edge
                    new_cnt = cnt
     
                heappush(nodes, [i, dist[i], new_remain, new_cnt])
     
        if end_node not in visited:
            return -1
     
     
    for start, end in Query:
        print(dijkstra(start - 1, end - 1, nei_graph))

### FIXED CODE ###

from scipy.sparse.csgraph import floyd_warshall

N, M, L = map(int, input().split())

G = [list(map(int, input().split())) for _ in range(M)]
Q = int(input())
Query = [list(map(int, input().split())) for _ in range(Q)]

# neighborhood graph
nei_graph = [[0] * N for _ in range(N)]
for a, b, c in G:
    nei_graph[a - 1][b - 1] = c
    nei_graph[b - 1][a - 1] = c

# Warshall Floyd
nei_graph = floyd_warshall(nei_graph)

# 1 if distance is less than L
for i in range(N):
    for j in range(N):
        if nei_graph[i][j] <= L:
            nei_graph[i][j] = 1
        else:
            nei_graph[i][j] = 0

nei_graph = floyd_warshall(nei_graph)

for start, end in Query:
    if nei_graph[start - 1][end - 1] - 1 == float('inf'):
        print(-1)
    else:
        print(int(nei_graph[start - 1][end - 1] - 1))
# B(TLE) 2104ms

N, K = map(int, input().split())
h = np.array(list(map(int, input().split())), dtype="int32")
cost = np.zeros(N, dtype="int32")

cost[0] = 0
for i in range(1,N):
    start = 0 if i < K else i-K
    cost[i] = np.min(cost[start:i] + np.abs(h[i]-h[start:i]))

print(cost[-1])


### FIXED CODE ###

# B(TLE) 2104ms

import numpy as np
N, K = map(int, input().split())
h = np.array(list(map(int, input().split())))
cost = np.zeros(N, dtype="int32")

cost[0] = 0
for i in range(1,N):
    start = 0 if i < K else i-K
    cost[i] = np.min(cost[start:i] + np.abs(h[i]-h[start:i]))

print(cost[-1])
'''
Created on 2020/09/15

@author: harurun
'''
import sys
pin=sys.stdin.readline


N,W=map(int,pin().split())
dp=[[0]*(W+1) for _ in [0]*(N+1)]

for i in range(1,N+1):
  w,v=pin().split()
  w=int(w)
  v=int(v)
  for j in range(W+1):
    if j-w>=0:
      dp[i][j]=max(dp[i-1][j],dp[i-1][j-w]+v)
    else:
      dp[i][j]=dp[i-1][j]
print(dp[N][W])


### FIXED CODE ###

"""メモリ足りねぇ..."""

import sys
pin=sys.stdin.readline

INF=10**10
N,W=map(int,pin().split())

dp=[[INF]*100001 for _ in [0]*(N+1)]
dp[0][0]=0
for i in range(1,N+1):
  w,v=pin().split()
  w=int(w)
  v=int(v)
  for j in range(100001):
    if j-v>=0:
      dp[i][j]=min(dp[i-1][j],dp[i-1][j-v]+w)
    else:
      dp[i][j]=dp[i-1][j]
ans=100000
while dp[N][ans]>W:
  ans-=1
print(ans)
#解説AC
N,X = map(int, input().split())
A = list(map(int, input().split()))

# ans = 10**13
ans = float("inf")

for k in range(N):
    tmp = k * X  

    for i in range(2*N):
        j = (i-k+N*4) % N
        A[i] = min(A[i], A[j])
    tmp += sum(A)

    ans = min(ans, tmp)
print(ans)


### FIXED CODE ###

N,X = map(int, input().split())
A = list(map(int, input().split()))

ans = float("inf")
bik = A[:]

get_idx_back = lambda idx,b: idx-b if idx>=b else idx+N-b

for loop in range(0, N+1):
  if loop == 0:
      bik = A[:]
  else: 
      for i in range(N):
          bik[i] = min(bik[i], A[ get_idx_back(i, loop) ])

  tmp = (loop)*X + sum(bik)

  ans = min(tmp, ans)
print(ans)
exit(0)
i = input()
i.split()
a = i[0]
b = i[1]

s = a * b
l = 2 * a + 2 * b

print(s,l)



### FIXED CODE ###

a,b = map(int,input().split())

s = a * b
l = 2 * a + 2 * b

print(s,l)
A,B=map(int,input().split())
if 0 == ((a*b)%2):
  print('even')
else:
  print('Obb’)


### FIXED CODE ###

a,b=map(int,input().split())
if ((a*b)%2) == 0:
  print('Even')
else:
  print('Odd')
n, m = map(int, input())
a = list(map(int, input().split()))[1:]
for i in range(n - 1):
  foods = list(map(int, input().split()))[1:]
  for food in a:
    if not food in foods:
      a.remove(food)
print(len(a))

### FIXED CODE ###

n, m = map(int, input().split())
likes = [0 for i in range(m + 1)]

for i in range(n):
  for food in list(map(int, input().split()))[1:]:
    likes[food] += 1
print(len(list(filter(lambda x: x==n, likes))))
import numpy as np
a, b, c, k = map(int, input().split())
aa = [1]*a
bb = [0]*b
cc = [-1]*c
nn = aa + bb + cc
su = 0
for i in range(0,k):
    su = su + nn[i]
print(su)

### FIXED CODE ###

a, b, c, k = map(int, input().split())
if a > k:
    print(k)
elif k >= a and b > k-a:
    print(a)
else:
    d = k - (a+b)
    print(a-d)
a=int(input())
b=int(input())

print(a*b-a-b+1)

### FIXED CODE ###

a,b=map(int,input().split())

print((a*b)-a-b+1)
#from decimal import *

#getcontext().prec = 20      # デフォルト28桁のところを20桁にする
#m = int(Decimal(n).sqrt())

def int_sqrt2(n):
    def f(prev):
        while True:
            m = (prev + n / prev) / 2
            if m >= prev:
                return prev
            prev = m
    
    return f(int(sqrt(n) * (1 + 1e-10)))

a, b, c = map(int, input().split())
#sqa = math.floor(math.sqrt(a)*10**(1000))/10**(1000)
#sqb = math.floor(math.sqrt(b)*10**(1000))/10**(1000)
#sqc = math.floor(math.sqrt(c)*10**(1000))/10**(1000)
#sqa = int(Decimal(a).sqrt())
#sqb = int(Decimal(b).sqrt())
#sqc = int(Decimal(c).sqrt())
sqa = int_sqrt2(a)
sqb = int_sqrt2(b)
sqc = int_sqrt2(c)



#sqa = float("{:.100f}".format(math.sqrt(a)))
#sqb = float("{:.100f}".format(math.sqrt(b)))
#sqc = float("{:.100f}".format(math.sqrt(c)))
 
#s = c - (a + b)
#t = 2 * sqa * sqb
if sqa + sqb < sqc:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

import math

a, b, c = map(int, input().split())


if c-a-b > 0 and 4*a*b < (c-a-b)**2:
  print("Yes")
else:
  print("No")
s=input()
print(s[0]+str(len(s)-2)+s[-1]

### FIXED CODE ###

s=input()
print(s[0]+str(len(s)-2)+s[-1])
S = list(input())
for i in range(len(S)):
  if i % 2 == 0:
   	if s[i] == "R" or "U" or "D":
      pass
   	else:
      print("No")
      exit()
  else:
    if s[i] == "L" or "U" or "D":
      pass
    else:
      print("No")
      exit()
print("Yes")


### FIXED CODE ###

S = list(input())
for i in range(len(S)):
	if i % 2 == 0:
		if (S[i] == "R") or(S[i] ==  "U") or(S[i] ==  "D"):
			continue
		else:
			print("No")
			exit()
	else:
		if (S[i] == "L") or(S[i] ==  "U") or(S[i] ==  "D"):
			continue
		else:
			print("No")
			exit()
print("Yes")
N=int(input())
import math

hoge=[[108]]

x=[3,5,7,11,13,17,19]
a=[pow(2,3)*i for i in x]

x=[2,5,7]
b=[pow(3,3)*i for i in x]

x=[5,7,11,13,17,19,23,29,31]
c=[2*3*i for i in x]

x=[7,11,13,17,19]
d=[2*5*i for i in x]

x=[11,13]
e=[2*7*i for i in x]

x=[7,11,13]
f=[3*5*i for i in x]

hoge.append(a)
hoge.append(b)
hoge.append(c)
hoge.append(d)
hoge.append(e)
hoge.append(f)


x=[]
for v in hoge:
  for item in v:
    x.append(item)

x.sort()
import numpy as np
X=[N-x[i] for i in range(len(x))]
XX=np.where(np.array(X) < 0) 
print(XX[0][0])

### FIXED CODE ###

import numpy as np
N=int(input())
x=[105, 135, 165, 189, 195]

X=[N-x[i] for i in range(len(x))]
XX=np.where(np.array(X) < 0) 
if N<195:
  print(XX[0][0])
else:
  print(5)
a , b = map ( int , input ( ).split ( ) )
if a > b :
    print ( a , ">" , b )
if a < b :
    print ( a , "<" , b )
if a == b :
    print ( a , "==" , b )

### FIXED CODE ###

a , b = map ( int , raw_input ( ) .split ( ) )
if a > b :
    print "a > b"
if a < b :
    print "a < b"
if a == b :
    print "a == b"
List = [int(input()) for i in range(n)]
if(List.index(7)) print('Yes'):
  else: print('No')

### FIXED CODE ###

a, b, c = input()  # 1234を整数(int)型ではなく、文字列(str)型で変数に格納する
if(a=="7" or b=="7" or c=="7"): print("Yes")
elif( a=="7" and b=="7"): print("Yes")
elif( c=="7" and b=="7"): print("Yes")
elif( c=="7" and a=="7"): print("Yes")
elif(a=="7" and b=="7" and c=="7"): print("Yes")
else:print("No")
from sympy import nextprime
x=int(input())
import math
if x < 2:
    print(nextprime(x))
else:
    if x == 2:
        print(x)
    else:
        if x % 2 == 0:
            print(nextprime(x))
        else:
            m = math.floor(x / 2) + 1
            for p in range(3, m, 2):
                if x % p == 0:
                    print(nextprime(x))
            print(x)

### FIXED CODE ###

x=int(input())
p=x**0.5
while any(x%i==0 for i in range(2,int(p)+1)):
  x+=1
else:
  print(x)
n, k = map(int, input().split())
a = list(map(int, input().split()))

ans = int((n-k)/(k-1)+2)

### FIXED CODE ###

inp = input()
plus = int(inp.count("+"))
minus = int(inp.count("-"))
print(plus-minus)
a=input()
b=a/3
print(b**3)
exit()

### FIXED CODE ###

a = int(input())
b=a/3
print(b**3)
exit()
import numpy as np

def main():
    row_input = input()
    A, B = list(map(int, input().split()))
    print(np.lcm(A, B))

if __name__ == "__main__":
    main()


### FIXED CODE ###

import fractions

def main():
    A, B = list(map(int, input().split()))
    print(lcm(A, B))

def lcm(a, b):
    return a * b // fractions.gcd(a, b)

if __name__ == "__main__":
    main()
def main():
    import sys
    input = sys.stdin.readline

    s = input()
    s = s[0:len(s)-1]
    Q = int(input())
    lq = [input().split() for _ in range(Q)]

    flg = 0 # 0:sonomama 1:gyakuten
    for q in lq:
        if q[0] == "1":
            if flg == 0:
                flg = 1
            else:
                flg = 0
        elif q[0]=="2":
            if (q[1] == "1" and flg ==0) or (q[1] == "2" and flg ==1):
                q[2] += s
                s = q[2]
            elif (q[1] == "2" and flg == 0) or (q[1] == "1" and flg == 1):
                s += q[2]

    if flg==1:
        s = s[::-1]
    print(s)

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    import sys
    input = sys.stdin.readline

    s = input()
    s = s[0:len(s)-1]
    Q = int(input())
    head = []
    tail = []

    flg = 0 # 0:sonomama 1:gyakuten
    for _ in range(Q):
        q = input().split()
        if q[0] == "1":
            if flg == 0:
                flg = 1
            else:
                flg = 0
        elif q[0]=="2":
            index,tmp = q[1],q[2]
            if (index == "1" and flg ==0) or (index == "2" and flg ==1):
                head.append(tmp)
            elif (index == "2" and flg == 0) or (index == "1" and flg == 1):
                tail.append(tmp)

    s1 = "".join(head)
    s1 = s1[::-1]
    s2 = "".join(tail)
    ans = s1 + s + s2
    if flg == 1:
        ans = ans[::-1]

    print(ans)

if __name__ == '__main__':
    main()
[n,k] = [int(i) for i in input().split()]
p = [(int(i)+1)/2 for i in input().split()]

a = []
#print(a)
ans = -1
ruiseki = []
for i in range(n-k+1):
    ruiseki.append(sum(p[i:i+k]))
print(max(ruiseki))


### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split()]
dic = {}
for i in range(n):
	try:
		dic[a[i]] += 1
	except:
		dic[a[i]] = 1
if max(dic.values()) > 1:
	print("NO")
else:
  	print("YES")
N = int(input())
S = []
C0 = 0
C1 = 0
C2 = 0
C3 = 0

for i in range(N-1):
    S = input()
    if S == AC:
        C0 = C0 + 1
    elif S == WA:
        C1 = C1 + 1
    elif SA == TLE:
        C2 = C2 + 1
    else:
        C3 = C3 + 1

print(C0, C1, C2, C3)
    

### FIXED CODE ###

N = int(input())
C0, C1, C2, C3 = 0, 0, 0, 0

for i in range(N):
    S = str(input())
    if S == "AC":
        C0 = C0 + 1
    elif S == "WA":
        C1 = C1 + 1
    elif S == "TLE":
        C2 = C2 + 1
    else:
        C3 = C3 + 1

print("AC x " + str(C0))
print("WA x " + str(C1))
print("TLE x " + str(C2))
print("RE x " + str(C3))
if a*b % 2 == 0:
    print('No')
else:
    print('Yes') 

### FIXED CODE ###

a, b = map(int, input().split())
if (a*b) % 2 == 0:
    print('No')
else:
    print('Yes')
N,Y = map(int,input().split())
flag = False
for i in range(N+1):
    for j in range(N+1-i):
        x = N - i - jint
        if x*1000 + j*5000 +i*10000 == Y:
            print(i,j,x)
            flag = True
            break
    if flag == True:
        break


if flag == False:
    print('-1 -1 -1')

### FIXED CODE ###

yukichi_num = 0
ichiyou_num = 0
d,e,f = -1,-1,-1
a,b = map(int,input().split())
for i in range(a+1):
    for  n in range(a+1-i):
        if i*10000+n*5000+1000*(a-i-n) == b:
            d = i
            e = n
            f = a-i-n
print('{0} {1} {2}'.format(d,e,f))
def main():
    n = input()
    a = list(map(lambda x:int(x),input().split(" ")))
    res = ""
    res = [str(a.index(i+1) + 1) for i in range(len(a))]
    print(" ".join(res))

if __name__ == '__main__':
    main()

### FIXED CODE ###

def myinput(rownum):
    res = []
    for i in range(rownum):
        temp = input().split(" ")
        res += temp
    return res

def main():
    r = int(myinput(1)[0])
    if r == 1:
        print(1)
    elif r % 2 == 0:
        print(0.5)
    else:
        print((int(r/2)+1)/r)

if __name__ == '__main__':
    main()