Harryxun/stf_run huggingface dataset:
import functools
import copy

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

def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a
n = 0

gcds = []
if N == 2:
    n = max(A)
else:
    for i in range(N-1):
        if i == 0:
            continue
        l = A[0:i]
        r = A[i+1:N]

        l_gcd = functools.reduce(lambda x, y: gcd(x, y), l)
        r_gcd = functools.reduce(lambda x, y: gcd(x, y), r)
        gcds.append(gcd(l_gcd, r_gcd))

print(max(gcds))


### FIXED CODE ###

import functools
import copy

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

def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a

l = [0] * N  #L_i, i = 0, 1, 2, ..., N-1
for i in range(N):
    if i == 0:
        continue
    else:
        l[i] = gcd(l[i-1], A[i-1])

r = [0] * N #R_i, i = 0, 1, 2, ..., N-1
for j in range(N):
    if j == 0:
        continue
    else:
        r[N-j-1] = gcd(r[N-j], A[N-j])

m = [0] * N
for i in range(N):
    m[i] = gcd(l[i], r[i])

print(max(m))
N, M = map(int, input().split())
p = [list(map(int, input().split())) + [i] for i in range(M)]
p.sort()
print(p)
i = 0
for n in range(1, N + 1):
    count = 1
    print(i, p[2][0])
    while not(i > n or p[i][0] != n):
        p[i] += [str(n).zfill(6) + str(count).zfill(6)]
        i += 1
        count += 1
p.sort(key=lambda x: x[2])
for a in p:
    print(a[3])

### FIXED CODE ###

N, M = map(int, input().split())
p = [list(map(int, input().split())) + [i] for i in range(M)]
p.sort()
i = 0
for n in range(1, N + 1):
    count = 1
    while not(i >= M or p[i][0] != n):
        p[i] += [str(n).zfill(6) + str(count).zfill(6)]
        i += 1
        count += 1
p.sort(key=lambda x: x[2])
for a in p:
    print(a[3])
import string
l=string.ascii_uppercase
N=int(input())
S=input()
T=""
for i in range(N):
  for j in range(26):
    if S[i]==l[j]:
      T+=l[i+N]
      break
print(T)

### FIXED CODE ###

import string
l=string.ascii_uppercase
N=int(input())
S=input()
T=""
for i in range(len(S)):
  for j in range(26):
    if S[i]==l[j]:
      T+=l[(j+N)%26]
      break
print(T)
s=str(input())
a=len(s)
b=[hi,hihi,hihihi,hihihihi,hihihihihi]
if a%2!=0:
  print('No')
elif s in b:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

s=str(input())
a=len(s)
b=['hi','hihi','hihihi','hihihihi','hihihihihi']
if a%2!=0:
  print('No')
elif s in b:
  print('Yes')
else:
  print('No')
import sys
sys.setrecursionlimit(10**7)
N = int(input())
li = [[int(x) for _ in input().split()] for _ in range(N)]
map = [[-1 for _ in range(101)] for _ in range(101)]
ans = ['0']*3
for i in range(101):
    for j in range(101):
        h = -1
        flag = True
        for x in li:
            if(h == -1):
                h=x[2]+abs(x[0]-i)+abs(x[1]-j)
            else:
                if(h!=x[2]+abs(x[0]-i)+abs(x[1]-j)):
                    flag = False
        if(flag):
            ans=[str(i),str(j),str(h)]
            break
print(ans[0]+' '+ans[1]+' '+ans[2])


### FIXED CODE ###

import sys
from operator import itemgetter
sys.setrecursionlimit(10**7)
N = int(input())
li = [[int(x) for x in input().split()] for _ in range(N)]
li.sort(key=itemgetter(2),reverse=True)
map = [[-1 for _ in range(101)] for _ in range(101)]
ans = [0]*3
for i in range(101):
    for j in range(101):
        h = -1
        flag = True
        for x in li:
            if(h == -1):
                h=x[2]+abs(x[0]-i)+abs(x[1]-j)
            else:
                if(x[2]!=0):
                    if(h!=x[2]+abs(x[0]-i)+abs(x[1]-j)):
                        flag = False
                else:
                    if(h>abs(x[0]-i)+abs(x[1]-j)):
                        flag = False
        if(flag):
            if(h>ans[2]):
                ans=[i,j,h]

print(str(ans[0])+' '+str(ans[1])+' '+str(ans[2]))
n = int(input())
for i in range(n):
  d = map(int, input().split())


answer = 'No'

count = 0
for i in range(n):
    if d[i][0] != d[i][1]:
        count = 0
    else:
        count += 1

    if count == 3:
        answer = 'Yes'
        break

print(answer)


### FIXED CODE ###

def judge():
    cnt = 0  
    for _ in range(N):
        x, y = map(int, input().split())
        if x == y:
            cnt += 1
        else:
            cnt = 0
        if cnt == 3:
            return True
    return False

N = int(input())

if judge():  
    print("Yes")
else:
    print("No")
a,b = input().split()
a = round(float(a)*100)
b = int(b)
print(a*b//100)

### FIXED CODE ###

a, b = input().split()
a = int(a)
b = round(float(b) * 100)
print(a * b // 100)
a  = input()
 
ans = 0
a = [int(i) for i in input().split()]
 
for num in a:
  ans += num - 1
  
 print(ans)

### FIXED CODE ###

a  = input()
 
ans = 0
a = [int(i) for i in input().split()]
 
for num in a:
  ans += num - 1
  
print(ans)
import math
from functools import reduce
def gcdl(numbers):
    return reduce(math.gcd, numbers)
n=int(input())
a=list(map(int,input().split()))
print(gcdl(a))

### FIXED CODE ###

from fractions import gcd
from functools import reduce
def gcdl(numbers):
    return reduce(gcd, numbers)
n=int(input())
a=list(map(int,input().split()))
print(gcdl(a))
import math
from collections import deque
def main():
    h,w = tuple([int(t)for t in input().split()])

    s = [['.']*(w+1)]

    s.extend(([list('.'+input()) for _ in range(h)]))

    dp = [[0]*(h+1) for _ in range(w+1)]

    for i in range(h):
        if s[i+1][1] == '.':
            dp[i+1][1] = dp[i][1]
        else:
            if s[i][1]=='.':
                dp[i+1][1] = dp[i][1]+1
            else:
                dp[i+1][1] = dp[i][1]

    for j in range(w):
        if s[1][j+1] == '.':
            dp[1][j+1] = dp[1][j]
        else:
            if s[1][j]=='.':
                dp[1][j+1] = dp[1][j]+1
            else:
                dp[1][j+1] = dp[1][j]

    for i in range(1,h):
        for j in range(1,w):
            if s[i+1][j+1] == '.':
                dp[i+1][j+1] = min(dp[i][j+1],dp[i+1][j])
            else:
                if s[i][j+1] == '.':
                    if s[i+1][j] == '.':
                        dp[i+1][j+1] = min(dp[i][j+1],dp[i+1][j])+1
                    else:
                        dp[i+1][j+1] = min(dp[i][j+1]+1,dp[i+1][j])
                else:
                    if s[i+1][j] == '.':
                        dp[i+1][j+1] = min(dp[i][j+1],dp[i+1][j]+1)
                    else:
                        dp[i+1][j+1] = min(dp[i][j+1],dp[i+1][j])

    print(dp[-1][-1])
if __name__ == "__main__":
    main()

### FIXED CODE ###

import math
from collections import deque
def main():
    h,w = tuple([int(t)for t in input().split()])

    s = [['.']*(w+1)]

    s.extend(([list('.'+input()) for _ in range(h)]))

    dp = [[0]*(w+1) for _ in range(h+1)]

    for i in range(h):
        if s[i+1][1] == '.':
            dp[i+1][1] = dp[i][1]
        else:
            if s[i][1]=='.':
                dp[i+1][1] = dp[i][1]+1
            else:
                dp[i+1][1] = dp[i][1]

    for j in range(w):
        if s[1][j+1] == '.':
            dp[1][j+1] = dp[1][j]
        else:
            if s[1][j]=='.':
                dp[1][j+1] = dp[1][j]+1
            else:
                dp[1][j+1] = dp[1][j]

    for i in range(1,h):
        for j in range(1,w):
            if s[i+1][j+1] == '.':
                dp[i+1][j+1] = min(dp[i][j+1],dp[i+1][j])
            else:
                if s[i][j+1] == '.':
                    if s[i+1][j] == '.':
                        dp[i+1][j+1] = min(dp[i][j+1],dp[i+1][j])+1
                    else:
                        dp[i+1][j+1] = min(dp[i][j+1]+1,dp[i+1][j])
                else:
                    if s[i+1][j] == '.':
                        dp[i+1][j+1] = min(dp[i][j+1],dp[i+1][j]+1)
                    else:
                        dp[i+1][j+1] = min(dp[i][j+1],dp[i+1][j])

    print(dp[-1][-1])
if __name__ == "__main__":
    main()
N,K = list(map(int,input().split()))
A = input()
A = list(A)
A = list(map(int,A))
l = [0]
s = []

for i in range(N-1):
    if A[i] != A[i+1]:
        l.append(i+1)
        s.append(l[len(l)-1]-l[len(l)-2])
l.append(N)
s.append(l[len(l)-1]-l[len(l)-2])
a = 0
right = 0
left = 0
g = 0
su = 0
if A[0] == 0:
    for i in range(len(s)):
        print(right)
        su +=s[right]
        if right%2==0:
            g += 1
        right +=1
        if g<=K:
            a = max(a,su)
        else:
            while g>K:
              su -= s[left]
              if left%2==0:
                  g -=1
              left +=1
        a = max(a,su)
else:
    for i in range(len(s)):
        su +=s[right]
        if right%2==1:
            g += 1
        right +=1
        if g<=K:
            a = max(a,su)
        else:
            while g>K:
              su -= s[left]
              if left%2==1:
                  g -=1
              left +=1
        a = max(a,su)

print(a)

### FIXED CODE ###

A,B = list(map(int,input().split()))
a = 0
for i in range(2):
    a= a+max(A,B)
    if A>B:
        A = A-1
    else:
        B = B-1
print(a)
x = int(input())

#y以上の値は候補とならない
y = int(math.sqrt(x))

k_max = 1
if y >= 2:
    for i in range(2, y + 1):
        j = int(math.log10(x) / math.log10(i))
        k = i ** j
        
        
        if k > k_max:
            k_max = k
    
print(k_max)

### FIXED CODE ###

import math

x = int(input())

#y以上の値は候補とならない
y = int(math.sqrt(x))

k_max = 1
if y >= 2:
    for i in range(2, y + 1):
        j = int(math.log10(x) / math.log10(i))
        k = i ** j
        
        
        if k > k_max:
            k_max = k
    
print(k_max)
def rec(i, s):
    if i >= n-1:
        res = s
    elif i == n-2:
        res = rec(i+1, s + abs(dif1[i]))
    else:
        res = min(rec(i+1, s + abs(dif1[i])), rec(i+2, s + abs(dif2[i])))
    return res


if __name__ == '__main__':
    n = int(input())
    dat = list(map(int, input().split()))

    dif1 = [abs(x-y) for (x, y) in zip(dat[1:], dat[:-1])]
    dif2 = [abs(x-y) for (x, y) in zip(dat[2:], dat[:-2])]

    print(rec(0, 0))

### FIXED CODE ###

def ans():
    dp = {i: 0 for i in range(n)}

    dp[1] = diff1[0]

    for i in range(2, n):
        dp[i] = min(dp[i-1] + diff1[i-1], dp[i-2] + diff2[i-2])
    return dp[n-1]


if __name__ == '__main__':
    n = int(input())
    dat = list(map(int, input().split()))

    diff1 = [abs(x-y) for (x, y) in zip(dat[1:], dat[:-1])]
    diff2 = [abs(x-y) for (x, y) in zip(dat[2:], dat[:-2])]

    print(ans())
N = input()
print(N*N*N)

### FIXED CODE ###

n=input()
print(n*n*n)
n = int(input().split())
lis = list(map(int,input().split()))
lis.sort(reverse = True)
cou = lis[1]
for i in range(2,n-1):
  if abs(cou - (lis[0]/2)) > abs(lis[i] - (lis[0]/2)):
    cou = lis[i]
print(lis[0],cou)

### FIXED CODE ###

n = int(input())
lis = list(map(int,input().split()))
a = max(lis)
lis.remove(a)
ans = 100000000000
for i in range(n-1):
	if abs(a/2 - lis[i]) < ans:
		ans = abs(a/2 - lis[i])
		an = lis[i]
print(a,an)
#-*- coding: utf-8 -*-
N,X = map(int,input().split())
li = list(map(int,input().split()))
d = 0
count = 1
for i in range(len(li)):
  d += li[i]
  if d <= x:
    count += 1
  else:
    break
print(count)

### FIXED CODE ###

#-*- coding: utf-8 -*-
X,A = map (int,input().split())
if X < A:
    print("0")
else:
    print("10")
arr=[j for j in input().split()]
arr=sorted(arr)
print(int(arr[0]*arr[1]/2)

### FIXED CODE ###

a,b,c=map(int,input().split())
arr=[a,b,c]
arr=sorted(arr)
print(int(arr[0]*arr[1]/2))
# B - Guidebook
import numpy as np
import pandas as pd 

N = int(input())
A, B = [[], []]

for _ in range(N):
  a, b = [i for i in input().split()]
  A.append(a)
  B.append(int(b))


A = np.array(A)[:, np.newaxis]
B = np.array(B)[:, np.newaxis]
C = np.concatenate([A, B], axis=1)
df = pd.DataFrame(C, index=[i+1 for i in range(N)])
df = df.sort_values([0, 1], ascending=[True, False])

for i in df.index:
  print(i)


### FIXED CODE ###

# B - Guidebook
import numpy as np
# import pandas as pd 

N = int(input())
A, B = [[], []]

for _ in range(N):
  a, b = [i for i in input().split()]
  A.append(a)
  B.append(int(b))


A = np.array(A)[:, np.newaxis]
B = np.array(B)[:, np.newaxis].astype('int')
C = np.concatenate([A, B], axis=1)
C = C.tolist()

ans = sorted(C, key=lambda x:(x[0],-int(x[1])))

for i in ans:
  print(C.index(i)+1)


"""
df = pd.DataFrame(C, index=[i+1 for i in range(N)])
df = df.sort_values([0, 1], ascending=[True, False])
"""
# for i in df.index:
#  print(i)
s = input()
slist = list(s)


number = int(slist(len(slist) - 1))

if number == 3:
  print('bon')
elif number == 0 or number == 1 or number == 6 or number == 8:
  print('pon')
else:
  print('hon')

### FIXED CODE ###

n = input()
slist = list(n)
number = int(slist[len(slist) - 1])

if number == 3:
  print('bon')
elif number == 0 or number == 1 or number == 6 or number == 8:
  print('pon')
else:
  print('hon')
n, k = map(int, input().split())
H = list(map(int, input().split()))

H.sort(reverse=True)
for i in range(k):
  H[i] = 0
  print(H)

print(sum(H))

### FIXED CODE ###

n, k = map(int, input().split())
H = list(map(int, input().split()))
if k>=n:
    print(0)
else:
  H.sort(reverse=True)
  for i in range(k):
    H[i] = 0

  print(sum(H))
N = int(input())
p = list(map(int,input().split()))

ans = 0

for i in range(N-1):
	if p[i] == i :
		ans += 1

if ans == N or N-2:
	print('Yes')
else :
	priint('No')

### FIXED CODE ###

N = int(input())
p = list(map(int,input().split()))
 
ans = 0
 
for i in range(N):
    if p[i] != (i+1) :
        ans += 1
 
if ans == 0:
    print('YES')
elif ans == 2:
      print('YES')
else :
    print('NO')
A, B = map(int, input().split())
if int(A/0.08*0.1) == B :
    print(round(A/0.08))
else:
    print(-1)


### FIXED CODE ###

S = input()
if S.find("A") == -1 or S.find("B") == -1:
    print("No")
else:
    print("Yes")
n = input()
a = input().split(' ')
nums = [int(str) for str in a]
sum = 0
nums.sort()
max = num[n-1]
min = num[0]
for i in nums:
 sum += i
print("{0} {1} {2}".format(min,max,sum))

### FIXED CODE ###

n = int(input())
a = input().split(' ')
num = [int(str) for str in a]
sum = 0
num.sort()
max = num[n-1]
min = num[0]
for i in num:
 sum += i
print("{0} {1} {2}".format(min,max,sum))
N = int(input())
l = list(map(int,input().split()))
count = 1
max = l[0]
for i in range(N):
  if max <= l[i]:
   	count += 1
    max = l[i]
print(count)

### FIXED CODE ###

n = int(input())
l = list(map(int,input().split()))
max = l[0]
count = 0
for i in range(n):
  if l[i] >= max:
    count += 1
    max = l[i]
    
print(count)
import numpy as np

n,d=map(int,input().split())
arr=np.array((n,d))
for i in range(n):
  arr[i]=np.array(list(map(float,input().split())))
ans=0
for i in range(n):
  for j in range(i,n):
    if j!=i:
      k = np.linalg.norm(arr[i]-arr[j],ord=2)
    else:
      k=np.nan
    if k==int(k):
      ans +=1
print(ans)

### FIXED CODE ###

import numpy as np

n,d=map(int,input().split())
arr=[]
for i in range(n):
  arr.append(list(map(int,input().split())))
arr =np.array(arr)
ans=0
for i in range(n):
  for j in range(i,n):
    if j!=i:
      k = np.linalg.norm(arr[i]-arr[j],ord=2)
    else:
      k=0.5
    if k==int(k):
      ans +=1
print(ans)
n,a,b= list(map(int, input().split()))
if a>b:
    print("0")
    exit(0)
else n==1:
    if a!=b:
        print("0")
    else:
        print("1")
    exit(0)
n-=2;b-=a;a=0
if n>=b:
    print(b*n+1)

### FIXED CODE ###

n,a,b= list(map(int, input().split()))
if a>b:
    print("0")
    exit(0)
if n==1:
    if a!=b:
        print("0")
    else:
        print("1")
    exit(0)
n-=2;b-=a;a=0
print(b*n+1)
n, p = map(int, input().split())
out=1
for i in range(2,p+1):
    while p%(i**n)==0:
        p = p//(i**n)
        out *= i
        
    if p < i**n:
        break
print(out)

### FIXED CODE ###

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

if n==1:
    print(p)
else:
    out=1
    tm = int(pow(p, 1/n))
    for i in range(2,tm+1):
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
        if p < i**n:
            break
    print(out)
import math
N = int(input())
S = str(input())

if N == 1:
    print('No')
    exit()

n = math.ceil(N/2)
j = True

for i in range(n):
    if S[i] != S[i + n]:
        j = False

if j:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

import math
N = int(input())
S = str(input())

if N == 1:
    print('No')
    exit()
if N%2 == 1:
    print('No')
    exit()

n = (N//2)
j = True


for i in range(n):
    if S[i] != S[i + n]:
        j = False

if j:
    print('Yes')
else:
    print('No')
N,W-map(int,input().split())
w=[]
v=[]
for i in range(n):
    a,b=map(int,input().split())
    w.append(a)
    v.append(b)
dp=[[10**10]*(N*(10**3)+1) for i in range(N+1)]
dp[0][0]=0
for i in range(1,N+1):
    for j in range(N*(10**3)+1):
        if j>=v[i]:
            dp[i][j]=min(dp[i-1][j-v[i]]+w[i],dp[i-1][j])
        else:
            dp[i][j]=dp[i-1][j]
for i in range(N*10**3,-1,-1):
    if dp[N][i]<=W:
        print(i)
        break

### FIXED CODE ###

N,W=map(int,input().split())
taple=[]
for i in range(N):
    w,v=map(int,input().split())
    taple.append((w,v))
dp=[[10**22]*(N*(10**3)+1) for i in range(N+1)]
dp[0][0]=0
for i in range(1,N+1):
    w,v=taple[i-1]
    for j in range(N*(10**3)+1):
        if j>=v:
            dp[i][j]=min(dp[i-1][j-v]+w,dp[i-1][j])
        else:
            dp[i][j]=dp[i-1][j]
for i in range(N*(10**3),-1,-1):
    if dp[N][i]<=W:
        print(i)
        break
n, m = [int(i) for i in input().split()]
E = [[] for i in range(n+1)]
used = [False] * (n + 1)
IN = [0] * (n + 1)

for i in range(m):
    a, b = [int(i) for i in input().split()]
    E[a].append(b)
    E[b].append(a)
    IN[a] += 1
    IN[b] += 1

cnt_4 = 0
cnt_6 = 0
for i in IN[1:]:
    if i % 2 == 1 or i == 0:
        print('No')
        exit()
    if i >= 4:
        cnt_4 += 1
    if i >= 6:
        cnt_6 += 1

if cnt_4 >= 2 or cnt_6 >= 1:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

#後ろにある数字を消していく

n = int(input())
B = [int(i) for i in input().split()]

ans = []

while len(B) > 0:
    for i in range(len(B) - 1, -1, -1):
        if B[i] == i + 1:
            ans.append(i + 1)
            del B[i]
            break
    else:
        print(-1)
        exit()

print(*ans[::-1], sep='\n')
a, b = map(int, input().split())
ans = [0, 1]
print(ans[(a + b) / 2])


### FIXED CODE ###

a, b = map(int, input().split())
ans = ["Even", "Odd"]
print(ans[(a * b) % 2])
n = int(input())
s = input()
dum1,dum2 = divmod(n,2)
flag = "ok"
if dum2 != 0:
  print("No")
else:
  for i in range(dum1):
    if s[i] != s[i+3]:
      flag = "ng"
      break
  if flag == "ng":
    print("No")
  else:
    print("Yes")

### FIXED CODE ###

n = int(input())
s = input()
dum1,dum2 = divmod(n,2)
flag = "ok"
if dum2 != 0:
  print("No")
else:
  for i in range(dum1):
    if s[i] != s[i+dum1]:
      flag = "ng"
      break
  if flag == "ng":
    print("No")
  else:
    print("Yes")
from math import sqrt

def func(a, b):
	if a == b:
		return (a - 1) * 2
	else:
		sq = int(sqrt(a * b))
		if a * b == sq ** 2:
			return (sq - 1) * 2 - 1
		elif sq * (sq + 1) >= a * b:
            return (sq - 1) * 2
		else:
			return sq * 2 - 1

q = int(input())
for _ in range(q):
	a, b = map(int, input().split())
	print(func(a, b))

### FIXED CODE ###

from math import sqrt

def func(a, b):
	if a == b:
		return (a - 1) * 2
	else:
		sq = int(sqrt(a * b))
		if a * b == sq ** 2:
			return (sq - 1) * 2 - 1
		elif sq * (sq + 1) > a * b:
			return (sq - 1) * 2
		elif sq * (sq + 1) == a * b:
			if abs(a - b) == 1:
				return (sq - 1) * 2
			else:
				return (sq - 1) * 2
		else:
			return sq * 2 - 1

q = int(input())
for _ in range(q):
	a, b = map(int, input().split())
	print(func(a, b))
n,s=int(input()),input()
print(max([s[0:i].count('I')-s[0:i].count('D') for i in range(n)]))

### FIXED CODE ###

a,b,c,d=map(int, input().split())
print(max(a*b,c*d))
import strutils, sequtils
var
  a, p = stdin.readline.split.map(parseFloat)
  n, k: int
(n, k) = a.map(toInt)

p = @[0.0] & p
for i in 1..n:
  p[i] *= (p[i]+1) / (2*p[i])
  p[i] += p[i-1]

var ans = 0.0
for i in 0..n-k: ans = max(ans, p[i+k]-p[i])
echo ans

### FIXED CODE ###

fact = [0]*1010
for i in range(1, 1010): fact[i] = fact[i-1]+i

n, k, *a = map(int, open(0).read().split())
a = list(map(lambda x:fact[x]/x, a))
ans = tmp = sum(a[:k])
for i in range(n-k):
    tmp -= a[i]
    tmp += a[i+k]
    ans = max(ans, tmp)
print(ans)
def main():
    n, k = map(int, input().split())
    ps = list(map(int, input().split()))
    ps = [(1+p)/2 for p in ps]

    print(ps)
    cumulative_sums = [sum(ps[:i+1]) for i in range(n)]
    ans = max([cumulative_sums[i+k] - cumulative_sums[i] for i in range(n-k)])
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    n, k = map(int, input().split())
    ps = list(map(int, input().split()))
    e = [(1+p)/2 for p in ps]

    s = [0]
    for i in range(n):
        s.append(s[i]+e[i])

    ans = max([s[i+k] - s[i] for i in range(n-k+1)])
    print(ans)


if __name__ == "__main__":
    main()
N = int(input())
t0 = 0
x0 = 0
y0 = 0
ans = True

for i in range(N):
    x,y,z = map(int,input().split())
    #t = int(next[0])
    #x = int(next[1])
    #y = int(next[2])
    time = t - t0
    range = abs(x - x0) + abs(y - y0)

    if time < range:
        ans = False
        break

    if time % 2 == 0:
       if range % 2 != 0:
          ans = False
          break
    else:
       if range % 2 == 0 or range == 0:
          ans = False
          break

    t0 = t
    y0 = y
    x0 = x



if ans == True:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

_ = int(input())
bef_time = 0
bef_x = 0
bef_y = 0
ans = True

for i in range(_):
    next = input().split()
    next_time = int(next[0])
    next_x = int(next[1])
    next_y = int(next[2])
    time = next_time - bef_time
    range = abs(next_x - bef_x) + abs(next_y - bef_y)

    if (next_time - bef_time) < range:
        ans = False
        break

    if time % 2 == 0:
       if range % 2 != 0:
          ans = False
          break
    else:
       if range % 2 == 0 or range == 0:
          ans = False
          break

    bef_time = next_time
    bef_y = next_y
    bef_x = next_x



if ans == True:
    print('Yes')
else:
    print('No')
S, T = input().split()
A, B = map(int, input().split())
U = input()
print(A-1 B if S==U else A B-1)

### FIXED CODE ###

S, T = input().split()
A, B = map(int, input().split())
U = input()
print(A-1 if S==U else A)
print(B if S==U else B-1)
L=int(input())
print((L/3)**3)

### FIXED CODE ###

n,m=map(int,input().split())
 
print(n*(n-1)//2+m*(m-1)//2)
def dfs(v,N,visit_list):

    all_visit = True

    for i in range(N):
        if visit_list[i] == False:
            all_visit = False
    
    if all_visit:
        return 1

    ret = 0

    for k in range(N):
        if Graph[v][k] == False:
            continue
        if visit_list[k] :
            continue
        
        visit_list[k] = True
        ret += dfs(k,N,visit_list)
        visit_list[k] = False
    return ret

visit_list = [False for i in range(N)]
visit_list[0] = True
print(dfs(0,N,visit_list))
    



### FIXED CODE ###

N,M = map(int,input().split())
pat = [[int(i) for i in input().split()] for _ in range(M)]
Graph = [[0 for i in range(N)] for _ in range(N)]
for i,j in pat:
    Graph[i-1][j-1] = 1
    Graph[j-1][i-1] = 1

def dfs(v,N,visit_list):

    all_visit = True

    for i in range(N):
        if visit_list[i] == False:
            all_visit = False
    
    if all_visit:
        return 1

    ret = 0

    for k in range(N):
        if Graph[v][k] == False:
            continue
        if visit_list[k] :
            continue
        
        visit_list[k] = True
        ret += dfs(k,N,visit_list)
        visit_list[k] = False
    return ret

visit_list = [False for i in range(N)]
visit_list[0] = True
print(dfs(0,N,visit_list))