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

from decimal import *


n = int(input())
ans = 0
vec = [Decimal(input()) for i in range(n)]
vec25 = [[-9, -9] for i in range(n)]  # 整数にするのに余っている2,5の数
for i in range(n):
    a = vec[i] * 1000000000
    while a%2 == 0:
        a //= 2
        vec25[i][0] += 1
    while a%5 == 0:
        a //= 5
        vec25[i][1] += 1
mp = {}
for p in vec25:
    k = p[0] * 10000 + p[1]
    if k in mp:
        mp[k] += 1
    else:
        mp[k] = 1
for k1, v1 in mp.items():
    x5 = k1 % 10000
    while x5 > 100:
        x5 -= 10000
    x2 = (k1 - x5) // 10000
    # print(k1, x2, x5)
    if x5 >= 0 and x2 >= 0:
        ans += v1 * (v1 - 1) // 2
    for k2, v2 in mp.items():
        y5 = k2 % 10000
        while y5 > 100:
            y5 -= 10000
        y2 = (k2 - y5) // 10000
        if x5 + y5 >= 0 and x2 + y2 >= 0 and k1 > k2:
            ans += v1 * v2
print(ans)

### FIXED CODE ###

from decimal import *

n = int(input())
ans = 0
vec = [Decimal(input()) for i in range(n)]
vec25 = [[0 for i in range(50)] for i in range(50)]  # 整数にするのに余っている2,5の数
for i in range(n):
    a = int(vec[i] * 1000000000)
    num2 = -9
    num5 = -9
    while a%2 == 0:
        a //= 2
        num2 += 1
    while a%5 == 0:
        a //= 5
        num5 += 1
    vec25[num2][num5] += 1
for i in range(-9, 40): 
    for j in range(-9, 20):
        for k in range(max(-9, -i), 40):
            for l in range(max(-9, -j), 20):
                if i+k >= 0 and j+l >= 0 :
                    if i != k or j != l :
                        ans += vec25[i][j] * vec25[k][l]
                    else :
                        ans += vec25[i][j] * (vec25[i][j] - 1)
ans //= 2
print(ans)
### BUGGY CODE ###

n = int(input())
ans = n - 1
a = 1
while a * a <= n:
  if n % a == 0:
    ans = min(ans, a - 1 + (n / a) - 1)
print(ans)

### FIXED CODE ###

n = int(input())
ans = n - 1
a = 1
while a * a <= n:
  if n % a == 0:
    ans = min(ans, a - 1 + (n // a) - 1)
  a += 1
print(ans)
### BUGGY CODE ###

def choose(n, r, M):
    x = 1
    y = 1

    for i in range(r):
        x *= (n - i) % M
        y *= (i + 1) % M
    res = x * pow(y, M-2, M) % M
    return res

n, a, b = map(int, input().split())
M = 10 ** 9 + 7

print((pow(2, n, M) - 1 - choose(n, a, M) - choose(n, b, M)) % M)

### FIXED CODE ###

def choose(n, r, M):
    x = 1
    y = 1

    for i in range(r):
        x = x * (n - i) % M
        y = y * (i + 1) % M
    res = x * pow(y, M-2, M) % M
    return res

n, a, b = map(int, input().split())
M = 10 ** 9 + 7

print((pow(2, n, M) - 1 - choose(n, a, M) - choose(n, b, M)) % M)
### BUGGY CODE ###

from functools import lru_cache

# 入力
N, x = map(int, input().split())
a = list(map(int, input().split()))

# a_i, a_{i + 1}, ..., a_j の最小値
@lru_cache(maxsize=None)
def f(i, j):
    return (
        a[i] if i == j else
        min(f(i, (j - 1) % N), a[j])
    )

# 変色回数を0からN-1まで決め打ちして解を求める
ans = min(
    sum(f(i, (i + k) % N) for i in range(N)) + k * x
    for k in range(N)
)

# 出力
print(ans)


### FIXED CODE ###

# 入力
N, x = map(int, input().split())
a = list(map(int, input().split()))

dp = [[0 for _ in range(N)] for i in range(N)]
for i in range(N):
    dp[i][i] = a[i]
    for k in range(1, N):
        j = (i + k) % N
        dp[i][j] = min(dp[i][(j - 1) % N], a[j])

# 変色回数を0からN-1まで決め打ちして解を求める
ans = min(
    sum(dp[i][(i + k) % N] for i in range(N)) + k * x
    for k in range(N)
)

# 出力
print(ans)
### BUGGY CODE ###

l, r = map(int, input().split())

item = l-r+1
if item >= 2019:
    print(0)
else:
    lt = []
    for j in range(l, r+1):
        for i in range(l, j):
            lt.append((i*j)%2019)
    print(min(lt))

### FIXED CODE ###

l, r = map(int, input().split())

item = r-l+1
if item >= 2019:
    print(0)
else:
    lt = []
    for j in range(l, r+1):
        for i in range(l, j):
            lt.append((i*j)%2019)
    print(min(lt))
### BUGGY CODE ###

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

a = []
for i in range(q):
    a.append(int(input()))

point = [k for _ in range(n)]

for i in range(q):
    for j in range(n):
        if a[i] != j:
            point[j - 1] -= 1

for i in range(n):
    if point[i] > 0:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

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

a = []
for i in range(q):
    a.append(int(input()))

point = [0 for _ in range(n)]

for i in range(q):
    point[a[i] - 1] += 1

for i in range(n):
    if k - q + point[i] > 0:
        print("Yes")
    else:
        print("No")
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
mod = 10 ** 9 + 7

# とりあえず二項係数を答えにぶち込む
fact = [1]
for i in range(1, N + 2):
    fact.append(fact[-1] * i % mod)


ans = [0] * (N + 2)
fN = fact[N + 1]
for i in range(1, N + 2):
    div = fact[i] * fact[N - i + 1] % mod
    value = fN * pow(div, mod - 2, mod) % mod
    ans[i] = value

# 数列Aの中に2つあるやつx
# xの左側、右側にあるやつをカウントする
x = max(set(A), key=A.count)
left = A.index(x)
right = N - A.index(x, left + 1)
M = left + right

for i in range(0, M + 1):
    num = fact[M]
    div = fact[i] * fact[M - i] % mod
    comb = num * pow(div, mod - 2, mod) % mod
    ans[i + 1] = (ans[i + 1] - comb + mod) % mod

print(*ans[1:], sep="\n")


### FIXED CODE ###

from collections import Counter

N = int(input())
A = tuple(map(int, input().split()))
mod = 10 ** 9 + 7

U = N + 10
fact = [1] * (U + 1)
inv = [1] * (U + 1)

for i in range(1, U + 1):
    fact[i] = fact[i - 1] * i % mod

inv[U] = pow(fact[i], mod - 2, mod)
for i in range(U, 0, -1):
    inv[i - 1] = inv[i] * i % mod


def comb(N, r):
    if r < 0 or r > N:
        return 0
    res = fact[N] * inv[r] % mod
    res = res * inv[N - r] % mod
    return res


X = Counter(A).most_common()[0][0]
left = A.index(X)
right = A[::-1].index(X)
LR = left + right

for i in range(1, N + 2):
    ans = comb(N+1, i)-comb(LR, i-1)
    ans = (ans + mod) % mod
    print(ans)
### BUGGY CODE ###

import math
import copy
import sys
import fractions
import numpy as np
from functools import reduce
import statistics
import heapq

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

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

n, m = map(int, input().split())
data = getSomeInputListInt(n)

data_list = [[0] for _ in range(m)]

for i in range(n):
    if data[i][0]-1 < m:
        data_list[data[i][0]-1].append(-data[i][1])

heap_list = []
heapq.heapify(heap_list)

ans = 0
for i in range(0, m):
    heap_list.extend(data_list[i])
    heapq.heapify(heap_list)
    a = heapq.heappop(heap_list)
    ans += a

print(-ans)

### FIXED CODE ###

import math
import copy
import sys
import fractions
import numpy as np
from functools import reduce
import statistics
import heapq

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

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

n, m = map(int, input().split())
data = getSomeInputListInt(n)

data_list = [[0] for _ in range(m)]

for i in range(n):
    if data[i][0]-1 < m:
        data_list[data[i][0]-1].append(-data[i][1])

heap_list = []
heapq.heapify(heap_list)
# heapq.heapify(data_list)

ans = 0
for j in range(m):
    for i in range(len(data_list[j])):
        heapq.heappush(heap_list, data_list[j][i])
    a = heapq.heappop(heap_list)
    ans += a

print(-ans)
### BUGGY CODE ###

A, B, N = map(int, input().split())
answer = 0

if B / 2 > N:
    num = reversed(range(1, N + 1))
else:
    num = range(1, N + 1)

for x in num:
    value = int(A * x / B) - A * int(x / B)
    if answer <= value:
        answer = value
    
    if x == B:
        break

print(answer)

### FIXED CODE ###

A, B, N = map(int, input().split())
answer = 0

if N < B:
    x = N
else:
    x = B - 1

value = int(A * x / B) - A * int(x / B)
print(value)
### BUGGY CODE ###

n = int(input())
x = input().split()
for i in range(n):
    x[i] = int(x[i])

for i in range(n):
    xm = x[:i] + x[i+1:]
    xm = sorted(xm)
    print(xm[int(n/2)-1])

### FIXED CODE ###

n = int(input())
x = input().split()
for i in range(n):
    x[i] = int(x[i])
xs = sorted(x)
ml = xs[n//2-1]
mr = xs[n//2]

for i in range(n):
    if x[i] <= ml:
        print(mr)
    elif x[i] >= mr:
        print(ml)
### BUGGY CODE ###

from collections import deque
n = int(input())
Ps = list(map(lambda x: int(x)-1, input().split()))
DIRC = [(-1, 0), (0, 1), (1, 0), (0, -1)]


def to_idx(p):
    return divmod(p, n)


def to_v(i, j):
    return i*n+j


cost = [0]*(n**2)
for v in range(n**2):
    i, j = to_idx(v)
    cost[v] = min(i, n-1-i, j, n-1-j)
exist = [1]*(n**2)


def bfs(init_v):
    next_v = deque([to_idx(init_v)])
    exist[init_v] = 0
    while next_v:
        i, j = next_v.popleft()
        for di, dj in DIRC:
            x, y = i+di, j+dj
            if x < 0 or y < 0 or n <= x or n <= y:
                continue
            c = cost[to_v(i, j)]+exist[to_v(i, j)]
            if cost[to_v(x, y)] <= c:
                continue
            cost[to_v(x, y)] = c
            next_v.append((x, y))


ans = 0
for p in Ps:
    ans += cost[p]
    bfs(p)
print(ans)

### FIXED CODE ###

from collections import deque
n = int(input())
Ps = list(map(lambda x: int(x)-1, input().split()))
cost = [min(i, n-1-i, j, n-1-j) for i in range(n) for j in range(n)]
exist = [1]*(n**2)


def to_idx(p):
    return divmod(p, n)


def to_v(i, j):
    return i*n+j


def bfs(init_v):
    next_v = deque([init_v])
    exist[init_v] = 0
    while next_v:
        v = next_v.popleft()
        i, j = to_idx(v)
        if 0 < i:
            v2 = v-n
            if cost[v2] > cost[v]+exist[v]:
                cost[v2] = cost[v]+exist[v]
                next_v.append(v2)

        if i < n-1:
            v2 = v+n
            if cost[v2] > cost[v]+exist[v]:
                cost[v2] = cost[v]+exist[v]
                next_v.append(v2)

        if 0 < j:
            v2 = v-1
            if cost[v2] > cost[v]+exist[v]:
                cost[v2] = cost[v]+exist[v]
                next_v.append(v2)

        if j < n-1:
            v2 = v+1
            if cost[v2] > cost[v]+exist[v]:
                cost[v2] = cost[v]+exist[v]
                next_v.append(v2)

ans = 0
for p in Ps:
    ans += cost[p]
    bfs(p)
print(ans)
### BUGGY CODE ###

import numpy as np
H, W = map(int, input().split())
S = np.zeros((H,W))
for i in range(H):
    Si = np.array([ 0 if s == '.' else 1 for s in input()])
    S[i] = Si

column_max_spaces = np.zeros(H)
for i in range(H):
    max_count = 0
    _count = 0
    for j in range(W):
        if S[i,j] == 0:
            _count += 1
        else:
            if _count > max_count:
                max_count = _count
            _count = 0
    else:
        if _count > max_count:
            max_count = _count
    column_max_spaces[i] = max_count

row_max_spaces = np.zeros(W)
for j in range(W):
    max_count = 0
    _count = 0
    for i in range(H):
        if S[i,j] == 0:
            _count += 1
        else:
            if _count > max_count:
                max_count = _count
            _count = 0
    else:
        if _count > max_count:
            max_count = _count
    row_max_spaces[j] = max_count

print(int(np.max(column_max_spaces) + np.max(row_max_spaces) - 1))

### FIXED CODE ###

import numpy as np
H, W = map(int, input().split())
S = np.zeros((H,W))
for i in range(H):
    Si = np.array([int(s == '.') for s in input()])
    S[i] = Si
    
top = S.copy()
bottom = S.copy()
left = S.copy()
right = S.copy()

for i in range(1, H):
    top[i] = (top[i-1] + 1) * S[i]
    bottom[-i-1] = (bottom[-i] + 1) * S[-i-1]

for j in range(1, W):
    left[:,j] = (left[:,j-1] + 1) * S[:,j]
    right[:,-j-1] = (right[:,-j] + 1) * S[:,-j-1]

print(np.max((top + bottom + left + right - 3).astype(np.int)))
### BUGGY CODE ###

import sys

input = lambda: sys.stdin.readline().rstrip()
mod = 10**9 + 7


def comb(n, k, mod):

    k = min(k, n - k)

    m = 1
    for i in range(n, n - k, -1):
        m = m * i % mod

    n = 1
    for i in range(1, k + 1):
        n = n * i % mod

    return (m * pow(n, mod - 2, mod)) % mod


def solve():
    N, K = map(int, input().split())
    blue = K
    red = N - K

    # i == 0
    print(red + 1)

    # i >= 1
    for i in range(1, blue):
        c = comb(blue - 1, i, mod)
        t = 0
        for j in range(i - 1, red):
            t += comb(j, i - 1, mod) * (red - j)
            t %= mod
        ans = (c * t) % mod
        print(ans)


if __name__ == '__main__':
    solve()


### FIXED CODE ###

import sys

input = lambda: sys.stdin.readline().rstrip()
mod = 10**9 + 7


class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """

    def __init__(self, n_max, mod=10**9 + 7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod

    def make_factorial_list(self, n):
        fac = [1]
        facinv = [1]
        for i in range(1, n + 1):
            fac.append(fac[i - 1] * i % self.mod)
            facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        modinv = [0] * (n + 1)
        modinv[1] = 1
        for i in range(2, n + 1):
            modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod
        return modinv


def solve():
    N, K = map(int, input().split())
    blue = K
    red = N - K
    comb = Combination(2000, mod)

    # i == 0
    print(red + 1)

    # i >= 1
    for i in range(1, blue):
        c = comb(blue - 1, i)
        t = 0
        for j in range(i - 1, red):
            t += comb(j, i - 1) * (red - j)
            t %= mod
        ans = (c * t) % mod
        print(ans)


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

#!/usr/bin/env python3
import sys

MOD = 1000000007  # type: int


def solve(N: int, A: "List[int]"):
    a_sum = [int()]*60

    for a in A:
        for i, r_a in enumerate(format(a, "b")[::-1]):
            if r_a == "1":
                a_sum[i] += 1

    a_sum = [a_s_*(2**i)%MOD for i, a_s_ in zip(range(60), a_sum)]
    a_acc_sum = [_ for _ in a_sum]
    for x in range(1,60):
        a_acc_sum[x] = a_acc_sum[x-1] + a_acc_sum[x] 
    
    ans = 0
    for a in A:
        for i, r_a in enumerate(format(a, "b")[::-1]):
            if r_a == "0":
                ans += a_sum[i]
        
        ans += a_acc_sum[59] - a_acc_sum[i]

        # for ic in range(i+1,60):
            # ans+=a_sum[ic]
            # ans%=MOD

    print(ans%MOD)

    return


# Generated by 1.1.6 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
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys

MOD = 1000000007  # type: int


def solve(N: int, A: "List[int]"):
    A = [format(a, "b")[::-1] for a in A]
    a_sum = [int()]*60

    for a in A:
        for i, r_a in enumerate(a):
            if r_a == "1":
                a_sum[i] += 1

    a_sum = [a_s_*(2**i)%MOD for i, a_s_ in zip(range(60), a_sum)]
    a_acc_sum = [_ for _ in a_sum]
    
    for x in range(1,60):
        a_acc_sum[x] = a_acc_sum[x-1] + a_acc_sum[x] 
    
    ans = 0
    for a in A:
        for i, r_a in enumerate(a):
            if r_a == "0":
                ans += a_sum[i]
        
        ans += a_acc_sum[59] - a_acc_sum[i]

        # for ic in range(i+1,60):
            # ans+=a_sum[ic]
            # ans%=MOD

    print(ans%MOD)

    return


# Generated by 1.1.6 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
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)

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

def main():
  n,m=map(int,input().split())
  a=[0]*m
  b=a[:]
  for i in range(m):
    a[i],b[i]=map(int,input().split())
  p=[y for (x,y) in zip(a,b) if x==1]
  q=[y for (x,y) in zip(a,b) if x==n]
  q+=[x for (x,y) in zip(a,b) if y==n]
  for i in p:
    if i in q:
      print("POSSIBLE")
      return
  print("IMPOSSIBLE")
main()

### FIXED CODE ###

def main():
    n, m = map(int, input().split())
    p = [False] * n
    q = p[:]
    for i in range(m):
        j, k = map(int, input().split())
        if j == 1:
            p[k] = True
        if j == n:
            q[k] = True
        elif k == n:
            q[j] = True
    for i in range(n):
        if p[i] and q[i]:
            print("POSSIBLE")
            return
    print("IMPOSSIBLE")


main()
### BUGGY CODE ###

S = input()

cands = ["dream", "dreamer", "erase", "eraser"]
searched = {}

queue = [""]
find_flag = 0
while len(queue) != 0:
    s = queue.pop(0)
    if s == S:
        find_flag = 1
        break
        
    for s_ in cands:
        if (s+s_ == S[:len(s)+len(s_)]) & (not searched.get(s+s_)):
            searched[s+s_] = 1
            queue.append(s+s_)

if find_flag:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

S = input()

candidates = ["dream", "dreamer", "erase", "eraser"]

find_flag = 0
rest_S = S
while True:
#     print(rest_S[-5:], rest_S[-7:]) 
    if len(rest_S) == 0:
        find_flag = 1
        break
    elif (len(rest_S) >= 7) & (rest_S[-7:] in candidates):
        rest_S = rest_S[:-7]
    elif (len(rest_S) >= 6) & (rest_S[-6:] in candidates):
        rest_S = rest_S[:-6]
    elif (len(rest_S) >= 5) & (rest_S[-5:] in candidates):
        rest_S = rest_S[:-5]
    else:
        break

if find_flag:
    print("YES")
else:
    print("NO")
### BUGGY CODE ###

from math import ceil
N,H = map(int,input().split())
A, B = [], []
for _ in range(N):
  a,b = map(int,input().split())
  A.append(a)
  B.append(b)

maxA = max(A)
B.sort(reverse=True)

ans = float('inf')
for nb in range(N+1):
  pointB = sum(B[:nb])
  ans = min(ans,ceil((H-pointB)/maxA)+nb)
print(ans)

### FIXED CODE ###

from math import ceil
import sys

N,H = map(int,input().split())
maxA = -float('inf')
B = []
for _ in range(N):
  a,b = map(int,sys.stdin.readline().split())
  maxA = max(maxA,a)
  B.append(b)

B.sort(reverse=True)

ans = float('inf')
pointB = 0
for nb in range(N+1):
  if nb != 0: pointB += B[nb-1]
  ans = min(ans,max(0,ceil((H-pointB)/maxA))+nb)
print(ans)
### BUGGY CODE ###

import heapq

n=int(input())
word={}

for i in range(n):
    tmpword=input()
    if tmpword in word:
        word[tmpword] = word[tmpword]+1
    else:
        word[tmpword] = 1


#ans.append(max(word.items(),key=lambda x:x[1])[0])
ans=[k for k, v in word.items() if v == max(word.values())]
cnt=len(ans)
heapq.heapify(ans)
for i in range(cnt):
    print(heapq.heappop(ans))

### FIXED CODE ###

from collections import Counter
import heapq

n=int(input())
word=[]
for i in range(n):
    word.append(input())

word_count=Counter(word)
ma=max(word_count.values())

ans=[k for k, v in word_count.items() if v == ma]
cnt=len(ans)
heapq.heapify(ans)
for i in range(cnt):
    print(heapq.heappop(ans))
### BUGGY CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, K = MAP()
P = LIST()

acc = [0]*N
for i in range(N):
	su = 0
	for j in range(1, P[i] + 1):
		su += j/P[i]
	acc[i] = su

ma = 0
for i in range(N - K + 1):
	ma2 = 0
	for j in range(K):
		ma2 += acc[i+j]
	if ma < ma2:
		ma = ma2

print(ma)

### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, K = MAP()
P = LIST()

acc = [0]*N
for i in range(N):
	su = (P[i]*(P[i]+1)/2)/P[i]
	acc[i] = su

accs = [0]*N
accs[0] = acc[0]
for i in range(1, N):
	accs[i] = accs[i - 1] + acc[i]

ma = 0
for i in range(K - 1, N):
	ma2 = 0
	if i == K - 1:
		ma2 = accs[i]
	else:
		ma2 = accs[i] - accs[i - K]
	if ma < ma2:
		ma = ma2

print(ma)
### BUGGY CODE ###

import re


n, q = map(int, input().split())
s = input()
ql = set(range(q))
for i in ql:
    ans = 0
    l1, l2 = map(int, input().split())
    s_part = s[l1 - 1:l2]
    s_re = re.findall(r'(AC)', s_part)
    ans = len(s_re)
    print(ans)

### FIXED CODE ###

n, q = map(int, input().split())
s = input()
t = [0] * (n + 1)
nl = set(range(n))
for i in nl:
    t[i + 1] = t[i] + (1 if s[i:i + 2] == 'AC' else 0)
ql = set(range(q))
for i in ql:
    l1, l2 = map(int, input().split())
    ans = t[l2-1] - t[l1-1]
    print(ans)
### BUGGY CODE ###

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

for i in range(int(M/N)):
    if M%(int(M/N)-i)==0:
        print((int(M/N-i)))
        exit()

### FIXED CODE ###

N,M=map(int,input().split())
ans=0
for i in range(1,10**5):
    if M%i==0:
        a=max(M//i,i)
        b=min(M//i,i)
        if M//a>=N and ans<a:
            ans=a
        if M//b>=N and ans<b:
            ans=b
print(ans)
### BUGGY CODE ###

n = int(input())
arr = list(map(int, input().split()))
k = int(input())
for _ in range(k):
    a,b = map(int, input().split())
    arr = [b if i==a else i for i in arr]
    print(sum(arr))

### FIXED CODE ###

n = int(input())
arr = list(map(int, input().split()))
k = int(input())
s = sum(arr)
d = {}
for i in arr:
    if i in d:
        d[i] += 1
    else:
        d[i] = 1
for _ in range(k):
    v = 0
    a,b = map(int, input().split())
    if a not in d:
        print(s)
        continue
    s += (b-a) * d[a]
    if b in d:
        d[b] += d[a]
    else:
        d[b] = d[a]
    print(s)
    del d[a]