Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

# -*- coding: utf-8 -*-
def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        divisor_list.append(1)
        for i in range(2, num // 2 + 1):
            if num % i == 0:
                divisor_list.append(i)
        divisor_list.append(num)

        return divisor_list

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

li = make_divisor_list(M)

ans = 1
for l in li:
    if l >= N:
        ans = max(ans,M//l)

# i = 1
# ans = 0
# tmp = 1000000000

# if M%N == 0:
#     ans = max(ans,M//N)
#     print(ans)
#     exit()

# while M//i >= i and N > i and i <= tmp:
#     if M%i == 0:
#         if tmp == 1000000000:
#             tmp = M//i
#         if M//i >= N:
#             ans = max(ans,i)
#     i += 1

print(ans)


### FIXED CODE ###

N,M = map(int,input().split())
ans = 1
i = 1
while i*i <= M:
    if M%i == 0 and M//N >= i:
        ans = max(ans,i)
        if M //i *N <= M:
            ans = max(ans,M//i)
    i += 1
print(ans)
### BUGGY CODE ###

n,k=map(int,input().split())
s,p=list(input()),""
for i in range(k):
	cur,d,p,p2=0,1,str(s),p
	while cur>=0 and cur<n:
		if s[cur]=='A':
			s[cur]='B'
			d=-d
			cur+=d
		else:
			s[cur]='A'
			cur+=d
	if str(s)==p:
		print(''.join(s))
		break
	elif str(s)==p2:
		if k%2==i%2:
			print(''.join(s))
		else:
			print(''.join(filter(lambda x:x=='A' or x=='B',list(p))))
		break
else:
	print(''.join(s))

### FIXED CODE ###

n,k=map(int,input().split())
s=list(input())*3
p=['A' if s[i]=='B' else 'B' for i in range(n)]*3
head,tail=0,n
for i in range(2*n):
	if s[head]=='A':
		s[head],p[head]='B','A'
	else:
		s,p=p,s
		head+=1
		s[tail],p[tail]='A','B'		
		tail+=1
	if i==k-1:
		print(''.join(s[head:tail]))
		break
else:
	if n%2==1 and k%2==1:
		if s[head]=='A':
			s[head],p[head]='B','A'
		else:
			s,p=p,s
			head+=1
			s[tail],p[tail]='A','B'		
			tail+=1
	print(''.join(s[head:tail]))
### BUGGY CODE ###

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

import sys

input = sys.stdin.readline

def main():
    S = input().strip()
    T = input().strip()

    T2 = T[:]
    for i in range(len(S)):
        if S[i] == T2[i]:
            continue
        from_c = T2[i]
        to_c = S[i]
        T2 = T2.translate(str.maketrans({from_c: to_c, to_c: from_c}))

    if S != T2:
        print("No")
    else:
        print("Yes")

main()


### FIXED CODE ###

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

import sys

input = sys.stdin.readline

def main():
    S = input().strip()
    T = input().strip()
    m = {}
    for i in range(len(T)):
        if T[i] in m:
            if m[T[i]] != S[i]:
                print("No")
                return
        m[T[i]] = S[i]

    T2 = T[:]
    for i in range(len(S)):
        if S[i] == T2[i]:
            continue
        from_c = T2[i]
        to_c = S[i]
        T2 = T2.translate(str.maketrans({from_c: to_c, to_c: from_c}))

    if S != T2:
        print("No")
    else:
        print("Yes")

main()
### BUGGY CODE ###

s = list(input())
n = int(input())
l = [input().split(" ") for _ in range(n)]

x = 0
for i in range(n):
    if l[i][0]=='1':
        if x == 0:
            x = 1
        else:
            x = 0
    elif l[i][0]=='2':
        if x == 0:
            if l[i][1]=='1':
                s = [l[i][2]] + s
            else:
                s = s + [l[i][2]]
        else:
            if l[i][1]=='1':
                s = s + [l[i][2]]
            else:
                s = [l[i][2]] + s
if x == 0:
    print(''.join(s))
else:
    print(''.join(reversed(s)))

### FIXED CODE ###

from collections import deque

s = deque(input())
n = int(input())
l = [input().split(" ") for _ in range(n)]

x = 0
for i in range(n):
    if l[i][0]=='1':
        if x == 0:
            x = 1
        else:
            x = 0
    elif l[i][0]=='2':
        if x == 0:
            if l[i][1]=='1':
                s.appendleft(l[i][2])
            else:
                s.append(l[i][2])
        else:
            if l[i][1]=='1':
                s.append(l[i][2])
            else:
                s.appendleft(l[i][2])

if x == 0:
    print(''.join(s))
else:
    print(''.join(reversed(s)))
### BUGGY CODE ###

N = int(input())
a = list(map(int, input().split()))

ans = 0

for m in range(2, 10000000):
  s = 0
  for i in range(N):
    s += m % a[i]
  ans = max(s, ans)
  
print(ans)

### FIXED CODE ###

# ans

N = int(input())
a = list(map(int, input().split()))

ans = 0

for i in range(N):
  ans += a[i] - 1
  
print(ans)
### BUGGY CODE ###

from collections import deque

def bfs(idx,k):
  q = deque()
  visited[idx] = True
  q.append(idx)
  color = 0
  while q:
    r = q.pop()
    for n in graph[r].keys():
      if not visited[n]:
        if color not in graph[r].values():
          graph[r][n] = color
          graph[n][r] = color
          color = (color+1)%k
        else:
          color = (color+1)%k
          graph[r][n] = color
          graph[n][r] = color
          color = (color+1)%k
        visited[n] = True
        q.append(n)

        
N = int(input())
graph = {}
visited = [False]*(N+1)
for i in range(N+1):
  graph[i] = {}
ab = []
for i in range(N-1):
  a,b = map(int,input().split())
  ab.append((a,b))
  graph[a][b] = -1
  graph[b][a] = -1
  
k = 0
for i in range(1,N+1):
  k = max(k,len(graph[i]))

bfs(1,k)
print(k)
for i in range(N-1):
  a,b = ab[i]
  print(graph[a][b]+1)

  


  


### FIXED CODE ###

from collections import deque

def bfs(idx,k,colored):
  q = deque()
  visited[idx] = True
  q.append(idx)
  while q:
    r = q.pop()
    color = 0
    for n in graph[r].keys():
      if not visited[n]:
        if color == colored[r]: color+=1
        colored[n] = color
        graph[r][n] = color
        graph[n][r] = color
        color += 1

        visited[n] = True
        q.append(n)

        
N = int(input())
graph = {}
colored = [-1]*(N+1)
visited = [False]*(N+1)
for i in range(N+1):
  graph[i] = {}
ab = []
for i in range(N-1):
  a,b = map(int,input().split())
  ab.append((a,b))
  graph[a][b] = -1
  graph[b][a] = -1
  
k = max([len(graph[i]) for i in range(1,N+1)])

bfs(1,k,colored)
print(k)
for a,b in ab:
  print(graph[a][b]+1)
### BUGGY CODE ###

n = int(input())
s = input()

hash = {}
for bit in range(1 << n):
    red, blue = "", ""
    for i in range(n):
        if (bit & (1 << i)) > 0:
            red += s[i]
        else:
            blue += s[i]
    hash[(red, blue)] = hash.get((red, blue), 0)+1

t = s[n:][::-1]
cnt = 0
for bit in range(1 << n):
    red, blue = "", ""
    for i in range(n):
        if (bit & (1 << i)) > 0:
            red += t[i]
        else:
            blue += t[i]
    cnt += hash.get((blue, red), 0)

print(cnt)


### FIXED CODE ###

n = int(input())
s = input()

hash = {}
for bit in range(1 << n):
    red, blue = "", ""
    for i in range(n):
        if (bit & (1 << i)) > 0:
            red += s[i]
        else:
            blue += s[i]
    hash[(red, blue)] = hash.get((red, blue), 0)+1

t = s[n:][::-1]
cnt = 0
for bit in range(1 << n):
    red, blue = "", ""
    for i in range(n):
        if (bit & (1 << i)) > 0:
            red += t[i]
        else:
            blue += t[i]
    cnt += hash.get((blue, red), 0)

print(cnt)
### BUGGY CODE ###

import queue
x=int(input())
avail=list(range(100,106))
q=queue.Queue()
for i in avail:
    q.put(i)
while not q.empty():
    f=q.get()
    for i in range(100,106):
        if(i+f<=x and i+f not in avail):
            avail.append(i+f)
            q.put(i+f)
print(1 if x in avail else 0)

### FIXED CODE ###

import queue
x=int(input())
avail=list(range(100,106))
ok=[False]*max(x+1,106)
q=queue.Queue()
for i in avail:
    ok[i]=True
    q.put(i)
while not q.empty():
    f=q.get()
    for i in range(100,106):
        if(i+f<=x and not ok[i+f]):
            ok[i+f]=True
            q.put(i+f)
print(1 if ok[x] else 0)
### BUGGY CODE ###

n,s = list(map(int,input().split())); arr = list(map(int,input().split()))

mod = 998244353
ans = 0
dp = [list() for i in range(s+1)]
if arr[0] < s+1:
    dp[arr[0]].append([0])

for i in range(1,n):
    tmp = arr[i]
    for j in range(s-tmp,0,-1):
        if dp[j]:
            dp[j+tmp] += [info+[i] for info in dp[j]]
    if tmp < s+1:
        dp[tmp].append([i])

for cmb in dp[s]:
    ans += (cmb[0]+1) * (n-cmb[-1])
    ans %= mod
    
print(ans)

### FIXED CODE ###

n,s = list(map(int,input().split())); arr = list(map(int,input().split()))

mod = 998244353
ans = 0
dp = [0]*(s+1)

for i in range(n):
    dp[0] += 1
    tmp = arr[i]
    for j in range(s,tmp-1,-1):
        dp[j] += dp[j-tmp]
    ans += dp[s]
    ans %= mod
print(ans)
### BUGGY CODE ###

n = int(input())
l = list(map(int, input().split()))
l.sort()
triangle = 0
while len(l) >= 3:
  max_l = l.pop()
  for i in range(1, len(l)):
    rest_l = max_l - l[i]
    for j in range(i):
      if l[j] > rest_l:
        triangle += i - j
        break
print(triangle)

### FIXED CODE ###

from bisect import bisect_left

n = int(input())
l = list(map(int, input().split()))
l.sort()
triangle = 0
for i in range(n-2):
  for j in range(i+1, n-1):
    index = bisect_left(l, l[i] + l[j], j + 1, n) - 1
    triangle += index - j
print(triangle)
### BUGGY CODE ###

# -*- coding: utf-8 -*-

r, g, b, n = map(int, input().split())

count = 0

for i in range(n//r+1):
    for j in range((n-i*r)//g+1):
        if (n - i*r - j*g) % b == 0 and (n - i*r - j*g) >= 0:
            count += 1

# for i in range(0, n+1):
#     for j in range(0, n+1):
#         for k in range(0, n+1):
#             if r*i + g*j + b*k == n:
#                 count += 1


print(count)


### FIXED CODE ###

# -*- coding: utf-8 -*-

r, g, b, n = map(int, input().split())

count = 0

for i in range(n//r+1):
    for j in range((n-i*r)//g+1):
        if (n - i*r - j*g) % b == 0:
            count += 1

# やってはいけないやつ
# for i in range(0, n+1):
#     for j in range(0, n+1):
#         for k in range(0, n+1):
#             if r*i + g*j + b*k == n:
#                 count += 1

print(count)
### BUGGY CODE ###

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

zumi = [-1]*(2*(10**5))
ima = 1
for i in range(K):
    # 行ったことある町を通る＝ループする
    if ima in zumi:
        zumi[i] = ima
        break
    # 同じ町へテレポートしている
    if ima == A[ima-1]:
        print(ima)
        exit(0)
    zumi[i] = ima
    ima = A[ima-1]
else:
    print(ima)
    exit(0)

loop_e = zumi.index(-1)
loop_s = zumi.index(zumi[loop_e-1])
zan_loop = K-loop_s
loop = zumi[loop_s:loop_e-1]
amari = zan_loop % (len(loop))
print(loop[amari])


### FIXED CODE ###

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

zumi_hash = {}
zumi = [-1]*(2*(10**5))
ima = 1
for i in range(K):
    # 行ったことある町を通る＝ループする
    if ima in zumi_hash:
        zumi[i] = ima
        break
    # 同じ町へテレポートしている
    if ima == A[ima-1]:
        print(ima)
        exit(0)
    zumi_hash[ima] = True
    zumi[i] = ima
    ima = A[ima-1]
else:
    print(ima)
    exit(0)

loop_e = zumi.index(-1)
loop_s = zumi.index(zumi[loop_e-1])
zan_loop = K-loop_s
loop = zumi[loop_s:loop_e-1]
amari = zan_loop % (len(loop))
print(loop[amari])
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**7)

N, Q = map(int,input().split())

# AB = [[int(x) for x in input().split()] for _ in range(N-1)]

# print(AB)

# 添字を1からにしたいのでN+1
graph = [[] for _ in range(N+1)]

# 各頂点に隣接する頂点
for _ in range(N-1):
    a, b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)

# print(graph)
counter = [0] * (N+1)

# print(counter)

# PX = [[int(x) for x in input().split()] for _ in range(Q)]

# 各頂点に点数を足す
for _ in range(Q):
  p, x = map(int, input().split())
  counter[p] += x


def shori(pa,c,val):
  val += counter[c]
  counter[c] = val
  for i in graph[c]:
    if i == pa:
      continue
    shori(c,i,val)
  
shori(0,1,0)
  

print(" ".join(map(str, counter[1:])))




### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

N, Q = map(int,input().split())

# AB = [[int(x) for x in input().split()] for _ in range(N-1)]

# print(AB)

# 添字を1からにしたいのでN+1
graph = [[] for _ in range(N+1)]

# 各頂点に隣接する頂点
for _ in range(N-1):
    a, b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)

# print(graph)
counter = [0] * (N+1)

# print(counter)

# PX = [[int(x) for x in input().split()] for _ in range(Q)]

# 各頂点に点数を足す
for _ in range(Q):
  p, x = map(int, input().split())
  counter[p] += x


def shori(pa,c,val):
  val += counter[c]
  counter[c] = val
  for i in graph[c]:
    if i == pa:
      continue
    shori(c,i,val)
  
shori(0,1,0)
  

print(" ".join(map(str, counter[1:])))
### BUGGY CODE ###

from collections import Counter

def burger(n):
  if n == 0:
    return '1'
  else:
    return '0' + burger(n-1) + '1' + burger(n-1) + '0'

N,X = map(int,input().split())
print(Counter(burger(N)[:X])['1'])


### FIXED CODE ###

def f(n, x):
    if n == 0:
        return min(x, 3)
    elif x == 0:
        return 0
    elif 0 < x and x <= layers_num[n - 1]:
        return f(n - 1, x - 1)
    elif x == 1 + layers_num[n - 1]:
        return p[n - 1] + 1
    elif 1 + layers_num[n - 1] < x <= 1 + 2 * layers_num[n - 1]:
        return p[n - 1] + 1 + f(n - 1, x - 2 - layers_num[n - 1])
    else:
        return 2 * p[n - 1] + 1


level0 = 'BPPPB'
N, X = map(int, input().split())

layers_num = []
p = []
for n in range(N):
    if n == 0:
        layers_num.append(len(level0))
        p.append(level0.count('P'))
    else:
        layers_num.append(layers_num[n - 1] * 2 + 3)
        p.append(2 * p[n - 1] + 1)

print(f(N - 1, X - 1))
### BUGGY CODE ###

from numpy import*
B=searchsorted
a,b=loadtxt(open(0),skiprows=1)
c=0
l=2**29
while l:y=sort(hstack((b%l-l,b%l)));A=l-a%l;l//=2;c+=sum(B(y,A)-B(y,A-l))%2*l
print(c)

### FIXED CODE ###

from numpy import*;B,I=searchsorted,lambda:int32(input().split());input();a,b=I(),I();c=0
for k in range(29):l=2**k;h=l*2;x,y=a%h,sort(b%h);y=hstack((y-h,y));c+=sum(B(y,h-x)-B(y,l-x))%2*l
print(c)
### BUGGY CODE ###

import heapq
def prim_heap():
    used = [True] * n #True:不使用
    edgelist = []
    for e in edge[0]:
        heapq.heappush(edgelist,e)
    used[0] = False
    res = 0
    while len(edgelist) != 0:
        minedge = heapq.heappop(edgelist)
        if not used[minedge[1]]:
            continue
        v = minedge[1]
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,e)
        res += minedge[0]
    return res

#########################
n = int(input())
zahyo = []
for i in range(n):
    x,y = map(int,input().split())
    zahyo.append([x,y])
edge = [[] for i in range(n)]
#隣接リスト edge[i]:[コスト,行先]
for i in range(n-1):
    for j in range(i+1,n):
        c = min(abs(zahyo[i][0]-zahyo[j][0]),abs(zahyo[i][1]-zahyo[j][1]))
        edge[j].append([c,i])
        edge[i].append([c,j])
print(prim_heap())

### FIXED CODE ###

import heapq
def prim_heap():
    used = [True] * n #True:不使用
    edgelist = []
    for e in edge[0]:
        heapq.heappush(edgelist,e)
    used[0] = False
    res = 0
    while len(edgelist) != 0:
        minedge = heapq.heappop(edgelist)
        if not used[minedge[1]]:
            continue
        v = minedge[1]
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,e)
        res += minedge[0]
    return res

#########################
n = int(input())
zahyo = []
for i in range(n):
    x,y = map(int,input().split())
    zahyo.append((x,y,i))
xza = sorted(zahyo)
yza = sorted(zahyo,key=lambda x: x[1])
edge = [[] for i in range(n)]
#隣接リスト edge[i]:[コスト,行先]
for i in range(n-1):
    c = abs(xza[i][0]-xza[i+1][0])
    edge[xza[i][2]].append((c,xza[i+1][2]))
    edge[xza[i+1][2]].append((c,xza[i][2]))
for i in range(n-1):
    c = abs(yza[i][1]-yza[i+1][1])
    edge[yza[i][2]].append((c,yza[i+1][2]))
    edge[yza[i+1][2]].append((c,yza[i][2]))
print(prim_heap())
### BUGGY CODE ###

[N,L] = [int(x) for x in input().split()]
A = {}
B = [0]*N
ANS = {}
count = 0
for i,x in enumerate(input().split()):
    i = int(i)
    x = int(x)
    B[i] = x
    if x in A : A[x] += [i]
    else : A[x] = [i]
for i in sorted(A) :
    for j in A[i] :
        for k in range(L) :
            if j + k not in ANS :
                ANS[j+k] = i
                count += 1
    if count * 1.01 > N : break
        
for i in range(L):
    if i not in ANS : ANS[i] = min(B[:i+1])
for i in range(L,N):
    if i not in ANS : ANS[i] = min(B[i+1-L:i+1])
for i in range(L-1,N-1) : print(ANS[i], end=" ")
print(ANS[N-1])

### FIXED CODE ###

def ascend(a,b):
    mini = min(A[a:a+L])
    ans[a] = mini
    for i in range(a+1,b):
        if A[i+L-1] <= mini : mini = A[i+L-1]
        elif A[i-1] == mini : mini = min(A[i:i+L])
        ans[i] = mini

def descend(a,b):
    mini = min(A[b-1:b+L-1])
    ans[b-1] = mini
    for i in range(b-2,a-1,-1):
        if A[i] <= mini : mini = A[i]
        elif A[i+L] == mini: mini = min(A[i:i+L])
        ans[i] = mini
    
[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = [None]*(N-L+1)
count = 0;
if N > 10 ** 4:
    for i in range(100):
        if A[i+1] > A[i] : count += 1
    if count > 80 : descend(0, N-L+1)
    else : ascend(0,N-L+1)
else :
    ascend(0, N-L+1)
for i in ans[:-1] : print(i, end=" ")
print(ans[-1])
### BUGGY CODE ###

import math
mod = 1000000007
N,M = list(map(int,input().strip().split()))
l = []

def P(n, r):
  return math.factorial(n)//math.factorial(n-r)
def C(n, r):
  return P(n, r)//math.factorial(r)

cnt = 0
while  M%2 == 0:
  M = M//2
  cnt += 1
l.append(cnt)
  
i = 3
while M != 1:
  cnt = 0
  while M%i == 0:
    M = M//i
    cnt += 1
  if cnt != 0:
    l.append(cnt)
  i += 2
  
ans = 1
for i in l:
  ans *= C(N+i-1,i)
  
print(ans%mod)

### FIXED CODE ###

import math
mod = 1000000007
N,M = list(map(int,input().strip().split()))
l = []

def P(n, r):
  return math.factorial(n)//math.factorial(n-r)

def C(n, r):
  return P(n, r)//math.factorial(r)

ans = 1
cnt = 0
while  M%2 == 0:
  M //= 2
  cnt += 1
l.append(cnt)
cnt = 0

i = 3
while i**2 <= M:
  cnt = 0
  while M%i == 0:
    M //= i
    cnt += 1
  if cnt != 0:
    l.append(cnt)
    cnt = 0
  i += 2
if M != 1:
    l.append(1)

for i in l:
  for j in range(i):
    ans = ans*(N+j)//(j+1)

print(ans%mod)
### BUGGY CODE ###

import sys

input = sys.stdin.readline
H, W, M = map(int, input().split())
h_count = [0]*H
w_count = [0]*W
HW = [tuple(map(int, input().split())) for _ in range(M)]
map = [[False]*W for _ in range(H)]
for h, w in HW:
    h_count[h-1] += 1
    w_count[w-1] += 1
    map[h-1][w-1] = True
h_max, w_max = 0, 0
hs, ws = [], []
for i in range(H):
    if h_max < h_count[i]:
        h_max = h_count[i]
        hs = [i]
    elif h_max == h_count[i]:
        hs.append(i)
for i in range(W):
    if w_max < w_count[i]:
        w_max = w_count[i]
        ws = [i]
    elif w_max == w_count[i]:
        ws.append(i)

cnt = len(hs)*len(ws)
for h in hs:
    for w in ws:
        if not map[h][w]:
            print(h_max+w_max)
            sys.exit()
print(h_max+w_max-1)


### FIXED CODE ###

import sys

input = sys.stdin.readline
H, W, M = map(int, input().split())
h_count = [0]*H
w_count = [0]*W
HW = [tuple(map(int, input().split())) for _ in range(M)]
for h, w in HW:
    h_count[h-1] += 1
    w_count[w-1] += 1
h_max, w_max = 0, 0
hs, ws = [], []
for i in range(H):
    if h_max < h_count[i]:
        h_max = h_count[i]
        hs = [i]
    elif h_max == h_count[i]:
        hs.append(i)
for i in range(W):
    if w_max < w_count[i]:
        w_max = w_count[i]
        ws = [i]
    elif w_max == w_count[i]:
        ws.append(i)

HW = set(HW)
for h in hs:
    for w in ws:
        if (h+1, w+1) not in HW:
            print(h_max+w_max)
            sys.exit()
print(h_max+w_max-1)
### BUGGY CODE ###

n, m = map(int, input().split())
a = list(map(int, input().split()))

for i in range(m):
    max_a = max(a)
    a.append(max_a / 2)
    a.remove(max_a)

res_list = [int(_) for _ in a]
print(sum(res_list))

### FIXED CODE ###

import heapq

n, m = map(int, input().split())
a = [-int(_) for _ in input().split()]

heapq.heapify(a)

for i in range(m):
    tmp = heapq.heappop(a)
    a.append(tmp / 2)

res_list = [int(-_) for _ in a]
print(sum(res_list))
### BUGGY CODE ###

n, k = map(int, input().split())
P = list(map(int, input().split()))

P_extracted = [0]
for i in range(0, (n-k)+1):
    tmp = P[i:i+k]
    # print(tmp)
    if sum(P_extracted) < sum(tmp):
        P_extracted = tmp

# print(s_max, P_max)
e = 0
for i in P_extracted:
    # tmp = 0
    e += sum(range(1, i+1)) / i
    # print(tmp)
    # e += tmp
print(e)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

INF = float('inf')

def tsum(l, r):
    return (r + l) * (r - l + 1) // 2

def exp(num):
    return tsum(1, num) / num

def solve():
    n, k = MI()
    P = LI()

    E = [0] * n
    pre = 0
    for i in range(n):
        E[i] = pre + exp(P[i])
        pre = E[i]
    # print(E)

    p = E[0]
    mx = E[k-1]
    for j in range(k, n):
        diff = E[j] - E[j-k]
        # print(diff)
        if mx < diff:
            mx = diff
    print(mx)


if __name__ == '__main__':
    solve()
### BUGGY CODE ###

import numpy as np

N, K = map(int, input().split())
S = np.array([])
for i in range(K):
    d = input()
    for j in input().split():
        S = np.append(S, [j])

print(N - np.unique(S).size)  # np.unique(np.array).sizeユニークな要素の個数


### FIXED CODE ###

N, K = map(int, input().split())
S = []
for i in range(K):
    d = input()
    for j in input().split():
        if j not in S:
            S.append(j)

print(N - len(S))
### BUGGY CODE ###

inf = 10**9

h,n = map(int,input().split())

ls = [list(map(int,input().split())) for _ in range(n)]

amax = max(a for a,b in ls)

dp = [0]*(h+amax)

for i in range(1,h+amax):
  m = inf
  for a,b in ls:
    tmp = dp[max(0,i-a)] + b
    m = min(m,tmp)
  dp[i] = m

print(min(dp[h:]))



### FIXED CODE ###

n,m=map(int, input().split())
s=[list(map(int, input().split())) for i in range(m)]
x=max(a for a,b in s)
dp=[0]*(n+x)
for i in range(0,n+x):
  if i>0:
    dp[i]=min(dp[i-a]+b for a,b in s)
print(min(dp[n:]))
### BUGGY CODE ###

A,B,K=map(int,input().split())
i=A
while i<=B:
    if abs(i-A)<K or abs(i-B)<K:
        print(i)
    i+=1

### FIXED CODE ###

A,B,K=map(int,input().split())
X=[i for i in range(A,min(B,A+K))]+[j for j in range(max(A,B-K+1),B+1)]
X=sorted(list(set(X)))
for x in X:print(x)
### BUGGY CODE ###

n, q = map(int, input().split())

ct = [0] * (n + 1)
target = {i: [i] for i in range(n + 1)}

for _ in range(n - 1):
    a, b = map(int, input().split())
    for k in target:
        if a in target[k]:
            target[k].append(b)

for _ in range(q):
    p, q = map(int, input().split())
    t = target[p]
    for ti in t:
        ct[ti] += q

print(*ct[1:])

### FIXED CODE ###

n, q = map(int, input().split())

ct = [0] * (n + 1)
e = [[] for _ in range(n + 1)]

for _ in range(n - 1):
    a, b = map(int, input().split())
    e[a].append(b)

qs = [0] * (n + 1)
for _ in range(q):
    p, q = map(int, input().split())
    qs[p] += q

target = [1]
while len(target):
    t = target.pop()
    ct[t] += qs[t]
    for nt in e[t]:
        target.append(nt)
        ct[nt] += ct[t]

print(*ct[1:])