Harryxun/stf_run huggingface dataset:
n = int(input())
info = [[int(i) for i in input().split()] for j in range(n)]
if n == 1:
    print(info[0][0], info[0][1], info[0][2])
else:
    for x in range(101):
        for y in range(101):
            for i in range(n):
                if i == 0:
                    cx = x
                    cy = y
                    h = info[i][2] + abs(cx - info[i][0]) + abs(cy - info[i][1])
                elif 0 < i < n-1:
                    if h != info[i][2] + abs(cx - info[i][0]) + abs(cy - info[i][1]):
                        break
                elif i == n-1:
                    if h == info[i][2] + abs(cx - info[i][0]) + abs(cy - info[i][1]):
                        kakutei_cx = cx
                        kakutei_cy = cy
                        kakutei_h = h
    print(kakutei_cx, kakutei_cy, kakutei_h)


### FIXED CODE ###

n = int(input())
info = [[int(i) for i in input().split()] for j in range(n)]
info.sort(key=lambda x:x[2])
if n == 1:
    print(info[0][0], info[0][1], info[0][2])
else:
    for i in range(n):
        if info[i][2] > 0:
            r = i
    for x in range(101):
        for y in range(101):
            h = info[r][2] + abs(x - info[r][0]) + abs(y - info[r][1])
            for i in range(n):
                if i < n-1 :
                    if info[i][2] == 0:
                        if h > abs(x - info[i][0]) + abs(y - info[i][1]):
                            break
                    else:
                        if h != info[i][2] + abs(x - info[i][0]) + abs(y - info[i][1]):
                            break
                elif i == n-1:
                    if h == info[i][2] + abs(x - info[i][0]) + abs(y - info[i][1]):
                        cx = x
                        cy = y
                        ch = h
    print(cx, cy, ch)
print(map(lambda x:x*((x%2*2),int(input()))

### FIXED CODE ###

N = int(input())
if N%2==0:
  print(N)
else:
  print(2*N)
import math
a,b,c,d = map(int,input().split())

#cで割り切れる数+dで割り切れる数-gcd(c,d)で割り切れる数を求めればよい
ans=(b//c+b//d-b//(c*d//math.gcd(c,d)))-((a-1)//c+(a-1)//d-(a-1)//(c*d//math.gcd(c,d)))

print(b-a+1-ans)


### FIXED CODE ###

s = input()
if s[0] != s[1] and s[1] != s[2] and s[2] != s[3]:
    print("Good")
else:
    print("Bad")
from math import *
r = int(input())
print(r * r * pi, 2 * r * pi)



### FIXED CODE ###

r = float(input())
print("{:.6f} {:.6f}".format(r * r * 3.14159265359, 2 * r * 3.14159265359))
N,X=map(int,input().split())

from functools import lru_cache
import sys

sys.setrecursionlimit(10*20)

@lru_cache(maxsize=None)
def count(N):
    if N == 0:
        return 1
    else:
        temp = pan(N-1)
        return 3 + 2 * count(N-1)
    
@lru_cache(maxsize=None)
def calc(N,X):
    if N == 0:
        return 1
    center = count(N-1) + 1
    if X == 0 :
        return 0
    elif X < center:
        return calc(N-1,X-1)
    elif X == center:
        return calc(N-1,center-2) + 1
    elif X > center:
        return calc(N-1,X-center-1) + calc(N,center)
print(calc(N,X-1))

### FIXED CODE ###

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

from functools import lru_cache
import sys

sys.setrecursionlimit(10*20)

@lru_cache(maxsize=None)
def count(N):
    if N == 0:
        return 1
    else:
        return 3 + 2 * count(N-1)
    
@lru_cache(maxsize=None)
def calc(N,X):
    if N == 0:
        return 1
    center = count(N-1) + 1
    if X == 0 :
        return 0
    elif X < center:
        return calc(N-1,X-1)
    elif X == center:
        return calc(N-1,center-2) + 1
    elif X > center:
        return calc(N-1,X-center-1) + calc(N,center)
print(calc(N,X-1))
n = int(input())
if 7 in n:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a = input()
b = 0
for i in a:
    i = int(i)
    if i == 7:
        b += 1
if b == 0:
    print("No")
else:
    print("Yes")
n=int(input())
A=set()
for i in range(n):
    a=input()
    if a in A:
        A.remove(a)
    else:
        A.append(a)
print(len(A))

### FIXED CODE ###

n=int(input())
A=set()
for i in range(n):
    a=input()
    if a in A:
        A.remove(a)
    else:
        A.add(a)
print(len(A))
mod = 10**9+7
N = int(input())
Ca = [int(input())-1 for i in range(N)]
C = []
p = -1
for c in Ca:
    if p != c:
        C.append(c)
    p = c
#print(C)
N = len(C)
L = [-1]*N
dp = [0]*N
dp[0] = 1
L[C[0]] = 0

for i, c in enumerate(C[1:], 1):
    if L[c] == -1:
        L[c] = i
        dp[i] = dp[i-1]
        continue
    else:
        dp[i] = (dp[i-1] + dp[L[c]]) % mod
        L[c] = i
print(dp[-1])


### FIXED CODE ###

mod = 10**9+7
N = int(input())
Ca = [int(input())-1 for i in range(N)]
C = []
p = -1
for c in Ca:
    if p != c:
        C.append(c)
    p = c
#print(C)
N = len(C)
if N<=2:
    print(1)
    exit()
L = [-1]*(2*10**5)
dp = [0]*N
dp[0] = 1
L[C[0]] = 0


for i, c in enumerate(C[1:], 1):
    if L[c] == -1:
        L[c] = i
        dp[i] = dp[i-1]
        continue
    else:
        dp[i] = (dp[i-1] + dp[L[c]]) % mod
        L[c] = i
print(dp[-1])
from collections import deque
import sys
sys.setrecursionlimit(1000000)

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**4
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


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

ans = 0
for i in range(n-k+1):
    ans += (-a[i] + a[-1-i]) * cmb(n-1-i, k-1,mod)
    ans %= mod
print(ans)

### FIXED CODE ###

from collections import deque
import sys
sys.setrecursionlimit(1000000)

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**6
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


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

ans = 0
for i in range(n-k+1):
    ans += (-a[i] + a[-1-i]) * cmb(n-1-i, k-1,mod)
    ans %= mod
print(ans)
#coding : utf8

while(True):
    line = input();

    if(line < 1000):
        print('ABC');
    else:
        print('ABD');


### FIXED CODE ###

line = input();

if(line < 1000):
    print('ABC');
else:
    print('ABD');
import collections

N = int(input())
l = [input() for _ in range(H)]

c = collections.Counter(l)

L = c.most_common()

values, counts = zip(*c.most_common())

A = list(values)
B = list(counts)

b = B.count(B[0])

a = A[0:b + 1]

[print(i) for i in a]

### FIXED CODE ###

import collections
 
N = int(input())
l = [input() for _ in range(N)]
 
c = collections.Counter(l)
 
L = c.most_common()
 
values, counts = zip(*c.most_common())
 
A = list(values)
B = list(counts)
 
b = B.count(B[0])
 
a = A[0:b]
c = sorted(a)

for i in c[0:]:
		print(i)
x=input()
print('ABC' if x<1200 else 'ARC')

### FIXED CODE ###

x=int(input())
print('ABC' if x<1200 else 'ARC')
#include <iostream>

int main()
{
  int x,t;
  std::cin >> x >> t;
  x = std::max<int>(0,x-t);
  std::cout << x << std::endl;
  return 0;
}

### FIXED CODE ###

X, t = map(int,input().split())
if X >= t:
  print(X-t)
else:
  print(0)
N = int(input())
for i in range(1, N):
    tmp = (i * 1.08) // 1
    if tmp == N:
        ans = i
        break
    elif tmp > N:
        ans = ':('
        break
print(ans)

### FIXED CODE ###

N = int(input())
# ans = ':('
for i in range(1, N+1):
    tmp = (i * 1.08) // 1
    if tmp == N:
        ans = i
        break
    elif tmp > N:
        ans = ':('
        break
print(ans)
import sys
from itertools import permutations

def main():
	while True:
		n, k = map(int, raw_input().split())
		if n == k == 0:
			sys.exit(0)
		nums = [raw_input().strip() for i in xrange(n)]
		result = set(["".join(p) for p in permutations(nums, k)])
		print (len(result))

if __name__ == '__main__':
	sys.exit(main())

### FIXED CODE ###

import sys
from itertools import permutations
 
def main():
	while True:
		line = raw_input()
		if line == "0 0": break
		n = int(line)
		k = input()
		nums = [raw_input().strip() for i in xrange(n)]
		result = set(["".join(p) for p in permutations(nums, k)])
		print (len(result))

if __name__ == '__main__':
	sys.exit(main())
# a から bで　cでもdでも割り切れないものの数を調べる
import math
#from fractions import gcd
Input = input()
a, b, c, d = Input.split()
a, b, c, d = int(a), int(b), int(c), int(d)
delta_c = b//c - a//c
delta_d = b//d - a//d
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
#    return (x * y) // gcd(x, y)
cd = lcm(c, d)
delta_cd = b//cd - a//cd
num_cd = delta_c + delta_d - delta_cd
print( b-a+1 - num_cd, end='')

### FIXED CODE ###

from fractions import gcd
Input = input()
a, b, c, d = Input.split()
a, b, c, d = int(a), int(b), int(c), int(d)
delta_c = b//c - (a-1)//c
delta_d = b//d - (a-1)//d
def lcm(x, y):
    return (x * y) // gcd(x, y)
cd = lcm(c, d)
delta_cd = b//cd - (a-1)//cd
num_cd = delta_c + delta_d - delta_cd
print( b-a+1 - num_cd, end='')
m,n = int(input())
if n = m:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

n = input().split(' ')
if n[1] == n[0]:
    print('Yes')
else:
    print('No')
S=[i for i in list(input())];N=len(S);k=['k','e','y','e','n','c','e']
for d in range(N-6):
    for i in range(N-d+1):
        s=S[:i]+S[i+d:];if s==k:
            print('YES');quit()
print('NO')

### FIXED CODE ###

S = [i for i in list(input())]
N = len(S)
k = [i for i in list('keyence')]

for d in range(N-6):
    for i in range(N-(d-1)):
        s = S[:i] + S[i+d:]
        if s==k:
            print('YES')
            quit()
print('NO')
S=str(input())
s=list(S)
x,y=map(int,input().split())
fora=0
side=[]
updw=[]
while s[0]=="F":
  fora+=1
  s.pop(0)
flag=1#1のとき横向き、-1のときたて向き
step=0
while s:
  if s[0]=="T":
    s.pop(0)
    if step:
      if flag==-1: updw+=[step]
      else: side+=[step]
    flag=flag*(-1)
    step=0
  else:
    s.pop(0)
    step+=1
    if len(s)==0:
      if flag==-1: updw+=[step]
      else: side+=[step]
ypossi=len(side)
tpossi=len(updw)
xdp=[[0 for i in range(2*len(S)+1)] for j in range(ypossi+1)]
#dp[i][j] i個文字使ったときにj+len(s)は達成できるか
xdp[0][fora+len(S)]=1 
for i in range(ypossi):
  for j in range(2*len(S)+1):
    if j-side[i]>=0:
      if xdp[i][j-side[i]]==1:xdp[i+1][j]=1
    if j+side[i]<2*len(S)+1:
      if xdp[i][j+side[i]]==1:xdp[i+1][j]=1
        
ydp=[[0 for i in range(2*len(S)+1)] for j in range(tpossi+1)]
#dp[i][j] i個文字使ったときにj+len(s)は達成できるか
ydp[0][len(S)]=1 
for i in range(tpossi):
  for j in range(2*len(S)+1):
    if j-updw[i]>=0:
      if ydp[i][j-updw[i]]==1:ydp[i+1][j]=1
    if j+updw[i]<2*len(S)+1:
      if ydp[i][j+updw[i]]==1:ydp[i+1][j]=1
if xdp[ypossi][x+len(S)]==1 and ydp[tpossi][y+len(S)]==1:
  print("Yes")
else: print("No")

### FIXED CODE ###

S=str(input())
s=list(S)
x,y=map(int,input().split())
fora=0
side=[]
updw=[]
while s[0]=="F":
  fora+=1
  s.pop(0)
  if len(s)==0:break
flag=1#1のとき横向き、-1のときたて向き
step=0
while s:
  if s[0]=="T":
    s.pop(0)
    if step:
      if flag==-1: updw+=[step]
      else: side+=[step]
    flag=flag*(-1)
    step=0
  elif s[0]=="F":
    s.pop(0)
    step+=1
    if len(s)==0:
      if flag==-1: updw+=[step]
      else: side+=[step]
  else: break
ypossi=len(side)
tpossi=len(updw)
X=sum(side)+fora+abs(x)
Y=sum(updw)+abs(y)
xdp=[[0 for i in range(2*X+1)] for j in range(ypossi+1)]
#dp[i][j] i個文字使ったときにj+len(s)は達成できるか
xdp[0][fora+X]=1 
for i in range(ypossi):
  for j in range(2*X+1):
    if j-side[i]>=0:
      if xdp[i][j-side[i]]==1:xdp[i+1][j]=1
    if j+side[i]<2*X+1:
      if xdp[i][j+side[i]]==1:xdp[i+1][j]=1

ydp=[[0 for i in range(2*Y+1)] for j in range(tpossi+1)]
#dp[i][j] i個文字使ったときにj+len(s)は達成できるか
ydp[0][Y]=1 
for i in range(tpossi):
  for j in range(2*Y+1):
    if j-updw[i]>=0:
      if ydp[i][j-updw[i]]==1:ydp[i+1][j]=1
    if j+updw[i]<2*Y+1:
      if ydp[i][j+updw[i]]==1:ydp[i+1][j]=1
if xdp[ypossi][x+X]==1 and ydp[tpossi][y+Y]==1:
  print("Yes")
else: print("No")
import sys
input = sys.stdin.readline
n, m = map(int, input().split())
PY = [list(map(int, input().split())) for _ in range(m)]
def make_id(num):
  s = len(str(num))
  add_zero = '0'*(6-s)
  return add_zero + str(num)

P = [[] for _ in range(m)]
for i in range(len(PY)):
  P[PY[i][0]-1].append(PY[i][1])
  P[PY[i][0]-1].sort()
for i in range(len(PY)):
  p,y=PY[i][0],PY[i][1]
  ord = P[p-1].index(y)+1
  print(make_id(p)+make_id(ord))


### FIXED CODE ###

N, M = map(int, input().split())
D = [[] for i in range(N)]
 
for i in range(M):
  p, y = map(int, input().split())
  D[p-1].append((y, i)) 

ans = [None]*M
 
for i, d in enumerate(D): 
  d.sort()
  for k, (y, j) in enumerate(d): 
    ans[j] = str(i+1).zfill(6) + str(k+1).zfill(6)
print(*ans, sep = '\n')
########### E
H, W, M = map(int, input().split())
bombs = []
for _ in range(M):
    bomb = list(map(int, input().split()))
    bombs.append(bomb)

H_list = [0]*H
W_list = [0]*W
sign = True
for i in range(M):
    H_list[bombs[i][0]-1] += 1
    W_list[bombs[i][1]-1] += 1

max_H = [i for i,k in enumerate(H_list) if k == max(H_list)]
max_W = [i for i,k in enumerate(W_list) if k == max(W_list)]

cross = []

for i in max_H:
    for k in max_W:
        if [i+1,k+1] not in bombs:
            sign = False
            print(max(H_list) + max(W_list))
            break
    break

if sign:

### FIXED CODE ###

import sys


H, W, M = map(int, input().split())
bomb = [tuple(map(lambda x: int(x) - 1, s.split())) for s in sys.stdin.readlines()]
X = [0] * H  # X:各行の爆破対象の個数
Y = [0] * W  # Y:各列の爆破対象の個数
for h, w in bomb:
    X[h] += 1
    Y[w] += 1
maxX = max(X)
maxY = max(Y)

R = [h for h, x in enumerate(X) if x == maxX]  # R:爆破対象の数が最大となる行の番号
C = [w for w, y in enumerate(Y) if y == maxY]  # C:爆破対象の数が最大となる列の番号

bomb = set(bomb)
for r in R:
    for c in C:
        if (r, c) not in bomb:
            # (r, c)に爆破対象が存在しないとき, maxX + maxY が答えとなることが確定するため, 
            # 即座に探索を終了する. これによりループの回数は最大でもM+1回となる.
            print(maxX + maxY)
            exit()
print(maxX + maxY - 1)
import sys
input = sys.stdin.readline
N, Z, W = [int(x) for x in input().strip().split()]
a = [int(x) for x in input().strip().split()]
d = {}
def minmax(x, y, c, f):
    # print('x={}, y={}, c={}, f={}'.format(x, y, c, f))
    if (x, y, c, f) in d:
        return d[(x, y, c, f)]
    if c == N:
        return abs(x - y)
    if f == 0:
        ret = -float('inf')
        for i in range(1, N - c + 1):
            ret = max(ret, minmax(a[c+i-1], y, c+i, f^1))
    else:
        ret = float('inf')
        for i in range(1, N - c + 1):
            ret = min(ret, minmax(x, a[c+i-1], c+i, f^1))
    d[(x, y, c, f)] = ret
    return ret

print(minmax(Z, W, 0, 0))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 5)
input = sys.stdin.readline
N, Z, W = [int(x) for x in input().strip().split()]
a = [int(x) for x in input().strip().split()]
d = {}
def minmax(x, y, c, f):
    # print('x={}, y={}, c={}, f={}'.format(x, y, c, f))
    if (c, f) in d:
        return d[(c, f)]
    if c == N:
        return abs(x - y)
    if f == 0:
        ret = -float('inf')
        for i in range(1, N - c + 1):
            ret = max(ret, minmax(a[c+i-1], y, c+i, f^1))
    else:
        ret = float('inf')
        for i in range(1, N - c + 1):
            ret = min(ret, minmax(x, a[c+i-1], c+i, f^1))
    d[(c, f)] = ret
    return ret

print(minmax(Z, W, 0, 0))
n,k = map(int,input().split())
import math

def c(x,y):
  return math.fractorial(x)//math.fractorial(x-y)*math.fractorial(y)

for i in range(1,k-1):
  sol = c(n+k-1,i)*c(k-1,i-1)
  ans = sol%(10**9+7)
  print(ans)
  





### FIXED CODE ###

import math
 
def combination_count(n,k):
    if k > n or k < 0:
        return 0
    if n == 0 or k == 0:
        return 1
    
    s = math.factorial(n)
    t = math.factorial(k)
    u = math.factorial(n-k)
    
    return s//(t*u)
    
n,k = map(int,input().split())
 
mod = 10**9 + 7
 
for i in range(1,k+1):
    x = combination_count(n-k+1,i) * combination_count(k-1, i-1)
    print(x%mod)
import math

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

if N == 1:
    print(x[0] - X)

else:
    diff = []

    for i in x:
        diff.append(abs(X - i))

    g = math.gcd(diff[0],diff[1])

    for i in range(1,len(diff)):
        g = math.gcd(g,diff[i])

    print(g)

### FIXED CODE ###

import fractions

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

if N == 1:
    print(abs(x[0] - X))

else:
    diff = []

    for i in x:
        diff.append(abs(X - i))

    g = fractions.gcd(diff[0],diff[1])

    for i in range(1,len(diff)):
        g = fractions.gcd(g,diff[i])

    print(g)
a,b,t = map(input,input().split())
ans = b*(t+0.5)//a
print(ans)


### FIXED CODE ###

a,b,t = map(int,input().split())
print((t//a)*b)
S = input()

print(s[0:3])

### FIXED CODE ###

s = input()

print(s[0:3])
n, k = map(int, input().split())
mod = 10**9+7
edges = []
for _ in range(n-1):
  edges.append(list(map(int, input().split())))

edge_dict = {}
for i in range(1, n+1):
  edge_dict[i] = set()

for edge in edges:
  edge_dict[edge[0]].add(edge[1])
  edge_dict[edge[1]].add(edge[0])

visited = set()

def visit(node, parent):
  if parent is not None:
    ans = (k - 1 - len(visited & (edge_dict[parent])))
  else:
    ans = k
  
  visited.add(node)
  
  for child in edge_dict[node]:
    if not child is parent:
      ans = (ans * visit(child, node))%mod
  
  return ans

print(visit(1, None))

### FIXED CODE ###

import queue

n, k = map(int, input().split())
edges = []
for _ in range(n-1):
  edges.append(list(map(int, input().split())))
mod = 10**9+7

edge_dict = {}
for i in range(1, n+1):
  edge_dict[i] = set()

for edge in edges:
  edge_dict[edge[0]].add(edge[1])
  edge_dict[edge[1]].add(edge[0])

visited = set()
q = queue.LifoQueue()
q.put(1)

num_cases = 1
while not q.empty():
  node = q.get()
  
  visited.add(node)
  num_available_colors = k -2 if node is not 1 else k -1
  
  for child in (edge_dict[node] - visited):
    num_cases *= num_available_colors
    num_available_colors -= 1
    num_cases %= mod
    q.put(child)

print((k*num_cases)%mod)
N=int(input())
A=map(int,input().split())
b=0
for i in range(N):
  b=b+1/A[i]
print 1/b

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
b=0
for i in range(N):
  b=b+1/A[i]
print(1/b)
# coding: utf-8
import math

A, B, C, D = map(int, input().split())
subst = abs(A - B)
num1 = subst // C + 1
num2 = subst // D + 1
num3 = subst // (C * D // math.gcd(C, D)) + 1

print(subst - num1 - num2 + num3 + 1)

### FIXED CODE ###

# coding: utf-8
# Your code here!
import fractions

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
    
a, b, c, d = map(int,input().split())
def cal(i, j, k):
    return i // j + i // k - i // lcm(j, k)

if a % c == 0 or a % d == 0:
    print(b - a - (cal(b, c, d) - cal(a, c, d)))
else:
    print(b - a - (cal(b, c, d) - cal(a, c, d)) + 1)
n, k = map(int, input().split())
a = list(map(int, input().split()))
mod = 10**9 + 7
ans = 1

if k == 1:
    max(a)
    exit()

lst = []
minus = []
for i in range(n):
    if a[i] >= 0:
        lst.append([a[i], 1])
    else:
        minus.append(a[i])

if k % 2 == 1 and lst != []:
    lst.sort(key=lambda x: x[0])
    ans *= lst.pop()[0]
    k -= 1
elif k % 2 == 1 and lst == []:
    a.sort(reverse=True)
    for i in range(k):
        ans *= a[i]
        ans %= mod
    print(ans)
    exit()

minus.sort(reverse=True)
while minus != []:
    if len(minus) >= 2:
        a = minus.pop()
        b = minus.pop()
        lst.append([a*b, 2])
    else:
        a = minus.pop()
        lst.pop([a, 1])

lst.sort(key=lambda x: x[0])
while k > 0:
    lst1 = lst.pop()
    lst2 = lst.pop()
    if [lst1[1], lst2[1]] == [1, 1]:
        ans *= lst1[0]
        ans %= mod
        ans *= lst2[0]
        ans %= mod
    elif [lst1[1], lst2[1]] == [1, 2]:
        ans *= lst2[0]
        ans %= mod
        lst.append(lst1)
    elif [lst1[1], lst2[1]] == [2, 1]:
        ans *= lst1[0]
        ans %= mod
        lst.append(lst2)
    else:
        ans *= lst1[0]
        ans %= mod
        lst.append(lst2)
    k -= 2
print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))
mod = 10**9 + 7
ans = 1

if k == n:
    for i in range(n):
        ans *= a[i]
        ans %= mod
    print(ans)
    exit()
if max(a) < 0 and k%2 == 1:
    a.sort(reverse=True)
    for i in range(k):
        ans *= a[i]
        ans %= mod
    print(ans)
    exit()

a.sort(key=lambda x: abs(x))
cnt = 0
for i in range(1, k+1):
    ans *= a[-i]
    ans %= mod
    if a[-i] < 0:
        cnt += 1

if cnt%2 == 0:
    print(ans)
else:
    a_plus = None
    a_minus = None
    b_plus = None
    b_minus = None
    for i in range(k, 0, -1):
        if a[-i] >= 0 and a_plus == None:
            a_plus = a[-i]
        if a[-i] < 0 and a_minus == None:
            a_minus = a[-i]
    for i in range(k+1, n+1):
        if a[-i] >= 0 and b_plus == None:
            b_plus = a[-i]
        if a[-i] < 0 and b_minus == None:
            b_minus = a[-i]
    if a_plus == None or b_minus == None:
        ans *= pow(a_minus, mod-2, mod)
        ans %= mod
        ans *= b_plus
        ans %= mod
    elif a_minus == None or b_plus == None:
        ans *= pow(a_plus, mod-2, mod)
        ans %= mod
        ans *= b_minus
        ans %= mod
    else:
        if abs(a_plus*b_plus) > abs(a_minus*b_minus):
            ans *= pow(a_minus, mod-2, mod)
            ans %= mod
            ans *= b_plus
            ans %= mod
        else:
            ans *= pow(a_plus, mod-2, mod)
            ans %= mod
            ans *= b_minus
            ans %= mod
    print(ans)
while True:
    x=input().split
    y=[int(x[0]),int(x[1])]
    if y[0]==0 and y[1]==0:
        break
    elif y[0]<y[1]:
        print("{} {}".format(y[0],y[1]))
    elif y[0]>y[1]:
        print("{} {}".format(y[1],y[0]))


### FIXED CODE ###

while True:
    x=input().split()
    y=[int(x[0]),int(x[1])]
    if y[0]==0 and y[1]==0:
        break
    elif y[0]<y[1]:
        print("{} {}".format(y[0],y[1]))
    elif y[0]>y[1]:
        print("{} {}".format(y[1],y[0]))
    else:
        print("{} {}".format(y[0],y[1]))
import math

A,B,X = map(int,input().split())

fullBottle = A*A*B

if fullBottle >= X*2:
    C = 2*X/(A*B)
    ans = math.degrees(math.atan(C/B))
    print(90-ans)
else:
    C = 2*(B-X/(A**2))
    ans = math.degrees(math.atan(A/C))
    print(90-ans)

### FIXED CODE ###

import math

A,B,X = map(int,input().split())

fullBottle = A*A*B

if fullBottle >= X*2:
    C = 2*X/(A*B)
    ans = math.degrees(math.atan(C/B))
    print(90-ans)
else:
    C = 2*(B-X/(A**2))
    ans = math.degrees(math.atan(C/A))
    print(ans)
a,b = input().split()

if (a+b)%2 == 0:
    print((a+b)/2)
else:
    print("IMPOSSIBLE")


### FIXED CODE ###

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

if (a+b)%2 == 0:
    print(int((a+b)/2))
else:
    print("IMPOSSIBLE")
N,K = map(int, input().split())
P = list(map(int,input().split()))

def calc_expected_val(val):
    return (1+val)/2

def main():
    expected_val = 0
    expected_val_list = []
    sum_val = 0
    sum_val_list = []
    sum_K = 0
    sum_K_list = []
    max_expected_val = 0
    for i in range(N):
        expected_val = calc_expected_val(P[i])
        expected_val_list.append(expected_val)
        sum_val += expected_val
        sum_val_list.append(sum_val)

    for j in range(K, N):
        sum_K = sum_val_list[j] - sum_val_list[j-K]
        sum_K_list.append(sum_K)

    max_expected_val = max(sum_K_list)
    print(max_expected_val)

if __name__ == "__main__":
    main()
    

### FIXED CODE ###

N, K = map(int, input().split())
p = list(map(int,input().split()))
ans = 0
cum = [0]
     
for i in range(len(p)):
    ex = (1 + p[i])/2
    p[i] = ex
        
for i in  range(len(p)):
    cum.append(p[i] + cum[i])
        
for i in range(K, N+1):
    ans  = max(ans, cum[i] - cum[i-K])
     
print(ans)