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

from collections import deque

N,M=map(int,input().split())
a=[set() for i in range(N)] # 0-index
for i in range(M):
    u,v=map(lambda x:int(x)-1,input().split())
    a[u].add(v)
S,T=map(lambda x:int(x)-1,input().split())
# print(a)
t=[]
for i in range(N):    
    ti=set()
    for u in a[i]:
        for v in a[u]:
            for w in a[v]:
                ti|={w}    
    t.append(ti)
# print(t)
r=[-1 for i in range(N)]
q=deque()
q.append(S);r[S]=0
while q:
    u=q.popleft()
    for v in t[u]:
        if r[v]==-1:
            r[v]=r[u]+1
            q.append(v)
# print(r)
print(r[T])

### FIXED CODE ###

from collections import deque

N,M=map(int,input().split())
a=[[[] for j in range(N)] for i in range(3)] # 0-indexのグラフが3つある
for i in range(M):
    u,v=map(lambda x:int(x)-1,input().split())
    a[0][u].append((1,v))
    a[1][u].append((2,v))
    a[2][u].append((0,v))
S,T=map(lambda x:int(x)-1,input().split())
# print(a)

r=[[-3 for j in range(N)] for i in range(3)]
q=deque()
q.append((0,S));r[0][S]=0
while q:
    ui,uj=q.popleft()
    for vi,vj in a[ui][uj]:
        if r[vi][vj]==-3:
            r[vi][vj]=r[ui][uj]+1
            q.append((vi,vj))
# print(r)
print(r[0][T]//3)
### BUGGY CODE ###

import math
N = int(input())

def minus_2(n):
    ans = ''
    if n == 1:
        ans.append('1')
    else:
        while n != 1:
            if n % -2 == 0:
                ans += '0'
            else:
                ans += '1'
            n = math.ceil(n/-2)
        ans += '1'
        ans = ans[::-1]
        
    return ans

ans = minus_2(N)

print(''.join(ans))

### FIXED CODE ###

import math
N = int(input())
 
def minus_2(n):
    ans = ''
    if n == 1:
        ans += '1'
    elif n == 0:
        ans += '0'
    else:
        while n != 1:
            if n % 2 == 0:
                ans += '0'
            else:
                ans += '1'
            n = math.ceil(n/-2)
        ans += '1'
        ans = ans[::-1]
        
    return ans
 
print(minus_2(N))
### BUGGY CODE ###

#!/user/bin/env python
#pythonプログラムであることを示している

# -*- coding: utf-8 -*-
"""
このプログラムはPythonを書く際のテンプレとなっています。これをコピペしてコーディングを行なってください。
なお字下げしないこと！！
"""

__author_ = 'Maruta Yuzuha'
__version_ = '1.0.0'
__date__ = '2019/12/25'

def main():
    """
    ここでプログラムの解説を行う
     >>main()
    Hello world.
    0
    """
    s = input().split()
    t = input().split()
    for i in range(int(s[0])):
        t[i] = int(t[i])
    a = 0  #勝つまでの回数
    c = sum(t)
    d = int(s[1])
    for i in range(int(s[1])):
        if sum(t) != 0:
            if d != 0:
                c -= max(t)
                for j in range(int(s[0])):
                    if max(t) == t[j]:
                        t[j] = 0
                d -= 1
            else:
                t[i] -= 1
                a += 1
    print(a+sum(t))
    return 0

if __name__ == '__main__':
    #上記のifの記述によってこのスクリプトファイルが起動された時だけ実行する部分になる。
    #ちなみにスクリプトが "モジュールとして"インポートされた時には実行されない、

    #単体テスト:モジュールのdocstring(ドキュメンテーション文字列)に記載された全ての対話実行例が書かれている通りに動作するかを確認
    #python ファイル名 -v
    import doctest
    doctest.testmod()

    #実際にmain()を呼び出して、結果を得て、その結果でPythonシステムを終える
    import sys
    sys.exit(main())

### FIXED CODE ###

#!/user/bin/env python
#pythonプログラムであることを示している

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

def main():
    """
    ここでプログラムの解説を行う
     >>main()
    Hello world.
    0
    """
    s = list(map(int, input().split()))
    t = list(map(int, input().split()))
    t.sort(reverse=True)
    a = 0  #勝つまでの回数
    b = s[0]#何匹か
    d = s[1]#必殺技の回数
    f = 0# Maxのいち
    # for j in range(d):  #必殺技の回数
    #     c = sum(t)
    #     if c != 0:
    #         g = max(t)
    #         for i in range(b):
    #             if g == t[i]:
    #                 t[i] = 0
    #                 break
    #         t[f] = 0
    #         f = 0
    #     else:
    #         break
    c = sum(t)
    for i in range(d):
        if c != 0:
            c -= t[i]
            t[i] = 0
        else:
            break
    a += sum(t)
    print(a)
    return 0

if __name__ == '__main__':

    #実際にmain()を呼び出して、結果を得て、その結果でPythonシステムを終える
    import sys
    sys.exit(main())
### BUGGY CODE ###

s = input()
q = int(input())
rev = 1
for i in range(q):
  t = input()
  
  if t == '1':
    rev *= -1
  else:
    x,y,sr = t.split()
    if (rev == 1 and y == '2') or (rev == -1 and y == '1'):
      s = ''.join([s,sr])
    else:
      s = ''.join([sr,s])

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

### FIXED CODE ###

from collections import deque
que1 = deque([])
que2 = deque([])
s = input()
q = int(input())
rev = 1
for i in range(q):
  t = input()
  
  if t == '1':
    rev *= -1
  else:
    x,y,sr = t.split()
    if (rev == 1 and y == '2') or (rev == -1 and y == '1'):
      que2.append(sr)
    else:
      que1.appendleft(sr)

s = ''.join(que1+deque([s])+que2)     
if rev == -1:
  s = s[::-1]
  
print(s)
### BUGGY CODE ###

N = int(input())
A = list(map(int,input().split()))
count_list = []
for i in range(min(A),max(A) + 1):
    count = A.count(i-1) + A.count(i) + A.count(i+1)
    count_list.append(count)
print(max(count_list))

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
l = [0]*(10**5)
for e in A:
    if e == 0:
        l[0] += 1
        l[1] += 1
    elif e == 99999:
        l[99999] += 1
        l[99998] += 1
    else:
        l[e-1] += 1
        l[e] += 1
        l[e+1] += 1
print(max(l))
### BUGGY CODE ###

import bisect

n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
for i in range(m):
    x = a.pop()
    bisect.insort(a, x // 2)
print(sum(a))


### FIXED CODE ###

import heapq

n, m = map(int, input().split())
a = list(map(lambda x: -int(x), input().split()))
heapq.heapify(a)
for i in range(m):
    x = heapq.heappop(a)
    heapq.heappush(a, -1 * (-x // 2))
print(-1 * sum(a))
### BUGGY CODE ###

import itertools
def solve():
    N = int(input())
    p = list(map(int, input().split()))
    chk = ""

    for i in range(N):
        if p[i] == i + 1:
            chk += "1"
        else:
            chk += "0"
    
    chk_splited = chk.split('0')

    cnt = 0
    for c in chk_splited:
        if len(c) % 2 == 0:
            cnt += len(c) / 2
        else:
            cnt += len(c) //2 + 1
    print(int(cnt))

if __name__ == '__main__':
    solve()


### FIXED CODE ###

import itertools
def solve():
    N = int(input())
    p = list(map(int, input().split()))

    one_cnt = 0
    swap_cnt = 0
    for i in range(N):
        if p[i] == i + 1:
            one_cnt += 1
        else:
            if one_cnt % 2 == 0:
                swap_cnt += one_cnt / 2
            else:
                swap_cnt += one_cnt // 2 + 1
            one_cnt = 0
    
    else:
        if one_cnt % 2 == 0:
            swap_cnt += one_cnt / 2
        else:
            swap_cnt += one_cnt // 2 + 1

    print(int(swap_cnt))

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

n,k=map(int,input().split())
a=list(map(int,input().split()))
t=1
for i in range(k):
  t=t*a[i]
for i in range(n-k):
  s=(t//a[i])*a[i+k]
  if s>t:
    print("Yes")
  else:
    print("No")
  t=s

### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n-k):
  if a[i+k]>a[i]:
    print("Yes")
  else:
    print("No")
### BUGGY CODE ###

import collections


def main():
    N = int(input())
    S = list(input())

    d = collections.defaultdict(int)
    for a in range(N):
        for b in range(a + 1, N):
            for c in range(b + 1, N):
                k = (S[a], S[b], S[c])
                d[k] += 1

    print(len(d.keys()))

main()


### FIXED CODE ###

import sys

readline = sys.stdin.buffer.readline


def main():
    N = int(readline())
    S = readline()
    S = S.decode("UTF-8")
    S = list(S[0:-1])

    cnt = 0
    for i in range(10):
        if str(i) in S:
            ind_i = S.index(str(i))
        else:
            continue
        for j in range(10):
            if str(j) in S[ind_i + 1:]:
                ind_j = S[ind_i + 1:].index(str(j))
                ind_j += ind_i + 1
            else:
                continue
            for k in range(10):
                if str(k) in S[ind_j + 1:]:
                    cnt += 1
                else:
                    continue

    print(cnt)


main()
### BUGGY CODE ###

n = int(input())
not_n = (int(i) for i in range(1,n))
print(sum(not_n))

### FIXED CODE ###

def main():
    n = int(input())
    not_n = ((n-1) * n)// 2
    print(not_n)
if __name__ == '__main__':
    main()
### BUGGY CODE ###

S = list(input())
N = len(S)
num = 0
cnt = [0]*2019
cnt[0] = 1
#T[i]: i+1文字目以降を数とみなしたときの数
for i in range(N-1, -1, -1):
    num += int(S[i]) * 10 ** (N-i-1)
    num %= 2019
    # num = (num + int(S[i]) * 10 ** (N- i -1)) % 2019
    cnt[num] += 1

ans = 0
for c in cnt:
    ans += c * (c-1) // 2
print(ans)

### FIXED CODE ###

s = input()[::-1] # 入力文字列を逆順でsに格納

counts = [0] * 2019
counts[0] = 1

num, d = 0, 1

for char in s:
    num += int(char) * d
    num %= 2019
    d *= 10
    d %= 2019
    counts[num] += 1

ans = 0
for cnt in counts:
    ans += cnt * (cnt - 1) // 2

print(ans) # 答えの出力
### BUGGY CODE ###

list1=list(input())
count=0
fin=0
while fin==0 and len(list1)>1:
    frug=0
    for i in range(len(list1)-1):
        if list1[i]=="B" and list1[i+1]=="W":
            count+=1
            list1[i]="W"
            list1[i+1]="B"
            frug=1
        if i==len(list1)-2 and frug==0:
            fin=1
print(count)

### FIXED CODE ###

list1=list(input())
list1.reverse()
a=0
count=0
for i in range(len(list1)):
    if list1[i]=="W":
        a=i
        break
for i in range(a,len(list1)):
    if list1[i]=="B":
        count+=i-a
        a+=1
print(count)
### BUGGY CODE ###

k = int(input())
def runrun(x):
    run = x + 1
    while(judg(run) == True):
        run += 1
    return run
def judg(x):
    list_x = list(str(x))
    flag = 0
    for i in range(len(list_x) - 1):
        if abs(int(list_x[i]) - int(list_x[i + 1])) <= 1:
            flag = 0
        else:
            flag = 1
            break
    if flag == 1:
        return True
    else:
        return False
ans = 1
if k == 1:
    print("1")
else:
    for i in range(k - 1):
        x = runrun(ans)
        ans = x
    print(x)

### FIXED CODE ###

k = int(input())
a = list()
old = list()
for i in range(1,10):
    a.append(i)
while(True):
    if k <= len(a):
        print(a[k - 1])
        break
    k -= len(a)
    old.clear()
    a,old = old,a
    for i in old:
        for d in range(-1,2):
            last_num = i % 10 + d
            if (last_num >= 0) and (last_num <= 9):
                new = 10 * i + last_num
                a.append(new)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(4100000)

line = input().split()
nPerson = int(line[0])
nFriend = int(line[1])
nBlock  = int(line[2])

friends = [[] for i in range(nFriend)]
for i in range(nFriend):
  line = input().split()
  friends[i] =[int(line[0]), int(line[1]) ]

blocks = [[] for i in range(nBlock)]
for i in range(nBlock):
  line = input().split()
  blocks[i] = [int(line[0]), int(line[1]) ]
  
connected = [[] for i in range(nPerson+1)]
  
for i in friends:
  connected[i[0]].append(i[1])
  connected[i[1]].append(i[0])

blocked = [[] for i in range(nPerson+1)]
for i in blocks:
  blocked[i[0]].append(i[1])
  blocked[i[1]].append(i[0])
  
for i in range(len(connected)):
  connected[i] = set(connected[i])
for i in range(len(blocked)):
  blocked[i] = set(blocked[i])
  
nCand = [0]*(nPerson+1)

def findCand(target,curPer):
  if visited[curPer] == True :
    return
  visited[curPer] = True
  if curPer not in connected[target] and curPer not in blocked[target]:
    nCand[target] += 1
  for i in connected[curPer]:
    findCand(target,i)

for i in range(1,nPerson+1):
  visited = [False]*(nPerson+1)
  visited[i] = True
  for j in connected[i]:
    findCand(i,j)

res = ""
for i in range(1,nPerson+1):
  res += str(nCand[i]) + " "
  
print(res)
  

### FIXED CODE ###

class unionFind():
  def __init__(self,n):
    self.size = n
    self.parents = [-1]*n
  def find(self, x):
     if self.parents[x] < 0:
       return x
     else:
       self.parents[x] = self.find(self.parents[x])
       return self.parents[x]
      
  def union(self, x, y):
    x = self.find(x)
    y = self.find(y)

    if x == y:
      return
    if self.parents[x] > self.parents[y]:
      x, y = y, x
    self.parents[x] += self.parents[y]
    self.parents[y] = x

  def grpsize(self, x):
    return -self.parents[self.find(x)]
  def roots(self):
    return [i for i, x in enumerate(self.parents) if x < 0]
  def members(self, x):
    root = self.find(x)
    return [i for i in range(self.size) if self.find(i) == root]
  def __str__(self):
    return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
      
import sys
sys.setrecursionlimit(4100000)

line = input().split()
nPerson = int(line[0])
nFriend = int(line[1])
nBlock  = int(line[2])

friends = [[] for i in range(nFriend)]
for i in range(nFriend):
  line = input().split()
  friends[i] =[int(line[0])-1, int(line[1])-1]

nconnected = [0]*nPerson
for i in friends:
    nconnected[i[0]] += 1
    nconnected[i[1]] += 1
  
  
blocks = [[] for i in range(nBlock)]
for i in range(nBlock):
  line = input().split()
  blocks[i] = [int(line[0])-1, int(line[1])-1]

uf = unionFind(nPerson)
for i in friends:
  uf.union(i[0],i[1])

nblocked = [0]*nPerson
for i in blocks:
  if uf.find(i[0]) == uf.find(i[1]):
    nblocked[i[0]] += 1
    nblocked[i[1]] += 1
  
res = ""
for i in range(nPerson):
  res += str(uf.grpsize(i)-nconnected[i] -nblocked[i]-1) + " "

print(res)
### BUGGY CODE ###

import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 998244353

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

N,S = LI()
A = LI()

beki = [1]*(N+1)
for i in range(1,N+1):
    beki[i] = beki[i-1]*2
    beki[i] %= mod

inv2 = pow(2,mod-2,mod)

d = defaultdict(int)
d[0] = beki[N]

ans = 0
for i in range(N):
    if 0 <= S-A[i] <= S:
        ans += d[S-A[i]]*inv2
        ans %= mod
    diff = defaultdict(int)
    for k in d.keys():
        if 0 < k+A[i] <= S:
            diff[k+A[i]] = d[k]*inv2
    for k in diff.keys():
        d[k] += diff[k]

print(ans)

### FIXED CODE ###

import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 998244353

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

N,S = LI()
A = LI()

beki = [1]*(N+1)
for i in range(1,N+1):
    beki[i] = beki[i-1]*2
    beki[i] %= mod

inv2 = pow(2,mod-2,mod)

d = [0]*(S+1)
d[0] = beki[N]

ans = 0
for i in range(N):
    if 0 <= S-A[i] <= S:
        ans += d[S-A[i]]*inv2
        ans %= mod
    diff = [0]*(S+1)
    for k in range(S-A[i]+1):
        diff[k+A[i]] = d[k]*inv2
    for k in range(S+1):
        d[k] += diff[k]
        d[k] %= mod

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

import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n,k=mii()
arr=limii()
temp=0
chk=0
for i in range(n-k+1):
    if chk < sum(arr[i:i+k]):
        temp=i
        chk=sum(arr[i:i+k])
    
aa=arr[temp:temp+k]

ans=0
for i in range(k):
    ans+=(aa[i]*(aa[i]+1)//2)/aa[i]
print(ans)



### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n,k=mii()
arra=limii()
arr=[]
s=[0]
chk=0
for i in range(n):
    arri=arra[i]
    arr.append((arri*(arri+1)//2)/arri)
    

for i in arr:s.append(s[-1]+i)

for i in range(n-k+1):
    chk=max(chk,s[i+k]-s[i])

print(chk)
### BUGGY CODE ###

L, R = map(int, input().split())
a=[]
for i in range(L,R+1):
  for j in range(L,R+1):
    if L<=i<j<=R:
      ans = (i*j) % 2019
      a.append(ans)
print(min(a))

### FIXED CODE ###

L, R = map(int, input().split())
a=[]

if R-L>=2019:
  ans=0
else:
  l, r = L%2019, R%2019
  ans=2018**2
  for i in range(l,r):
    for j in range(l+1,r+1):
        k = (i*j) % 2019
        ans = min(ans,k)
print(ans)
### BUGGY CODE ###

l, r = map(int, input().split())
mod = 2019  # 素数ではない (素数は 673)
r = min(r, l+mod*2)

res = mod
for i in range(l, r):
    for j in range(r, l-1, -1):
        if i == j:
            break
        tmp = i*j % mod
        if tmp < res:
            res = tmp

print(res)

### FIXED CODE ###

l, r = map(int, input().split())
mod = 2019
r = min(r, l+673)

res = mod
for i in range(l, r):
    for j in range(r, l-1, -1):
        if i == j:
            break
        tmp = i*j % mod
        if tmp < res:
            res = tmp

print(res)
### BUGGY CODE ###

import sys

S = list(input())
count,chk_count=0,0
for i in range(sys.maxsize):
    chk_count=count
    for j in range(len(S)-1):
        if S[j]=="B" and S[j+1]=="W":
            S[j],S[j+1] ="W","B"
            count+=1
    if chk_count == count:
        print(count)
        exit()

### FIXED CODE ###


S = input()
count=0
w=0
for i in range(len(S)):
    if S[i] =="W":
        count+=i-w
        w+=1
print(count)
### BUGGY CODE ###

import bisect

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


#print(L)

ans=0
for i in range(0, n-2,1):
  for j in range(i+1,n-1,1):
    min_sum = L[i]+L[j]
    more_than = bisect.bisect_left(L[j+1:], min_sum)
    ans += more_than
print(ans)


### FIXED CODE ###

from bisect import bisect_left
N = int(input())
L = sorted(list(map(int, input().split())))
ans = 0
for i in range(N):
    for j in range(i+1,N):
        ans += bisect_left(L, L[i]+L[j])-j-1
print(ans)
### BUGGY CODE ###

import sys
import itertools

input = sys.stdin.readline
MOD = 1000000007

N = int(input())

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

dic = {}

b = []
for i in range(len(A)):
    dic[i+1] = A[i]
    b.append(i+1)

dic_sorted = sorted(dic.items(),key=lambda x:x[1])



c = list(itertools.combinations(b,2))

res = 0
for i in c:
    if (dic[i[1]] + dic[i[0]]) == abs(i[0] - i[1]):
        res+=1

print(res)



### FIXED CODE ###

#import sys
import numpy as np

#input = sys.stdin.readline
MOD = 1000000007


N = int(input())

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

M = {}
res = 0
for i in range(len(A)):
    if (A[i]+i) not in M:
        M[A[i]+i] = 1
    else:
        M[A[i]+i] +=1
    
    if (i - A[i]) in M:
        res+=M[i-A[i]]

print(res)
### BUGGY CODE ###

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

p = list(map(int,input().split()))
max = 0
for i in range(N-K+1):
    tmp = 0
    tmp += ((p[i]*(1+p[i]))/2)/p[i]
    for j in range(K-1):
        tmp += ((p[i+j+1]*(1+p[i+j+1]))/2)/p[i+j+1]
    if max < tmp:
        max = tmp
        
print(max)



### FIXED CODE ###

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

p = list(map(int,input().split()))
max = 0
for i in range(K):
    max += (1+p[i])/2
tmp = max
for i in range(K,len(p)):
    tmp -= (1+p[i-K])/2
    tmp += (1+p[i])/2
    #print(max)
    if max < tmp:
        max = tmp
    #print(max)    
print(max)




#ロケットペンシル方式
### BUGGY CODE ###

from collections import deque

H,W  = [int(v) for v in input().split()]
S = ['#'+input()+'#' for _ in range(H)]
S.insert(0,"#"*(W+2))
S.append("#"*(W+2))

ans = 0

for y in range(1,H+1):
    for x in range(1,W+1):
        if S[y][x] == "#": continue
        queue = deque([[x,y,0]])
        visited = [[False for _ in range(W+2)] for _ in range(H+2)]
        visited[y][x] = True
        while queue:
            x,y,c = queue.pop()
            visited[y][x] = True
            for ny,nx in [[y+1,x],[y,x+1],[y-1,x],[y,x-1]]:
                if visited[ny][nx] or S[ny][nx] == '#': continue
                queue.appendleft([nx,ny,c+1])

            ans = max(ans,c)
print(ans)


### FIXED CODE ###

from collections import deque

H,W  = [int(v) for v in input().split()]
S = ['#'+input()+'#' for _ in range(H)]
S.insert(0,"#"*(W+2))
S.append("#"*(W+2))

ans = 0

for y in range(1,H+1):
    for x in range(1,W+1):
        if S[y][x] == "#": continue
        queue = deque([[x,y,0]])
        visited = [[False] * (W+2) for _ in range(H+2)]
        visited[y][x] = True

        while queue:
            x,y,c = queue.pop()
            for ny,nx in [[y+1,x],[y,x+1],[y-1,x],[y,x-1]]:
                if visited[ny][nx] or S[ny][nx] == '#': continue
                visited[ny][nx] = True
                queue.appendleft([nx,ny,c+1])
            ans = max(ans,c)
print(ans)
### BUGGY CODE ###

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

s = []
for i in range(1,N+1):
  print(A.index(i)+1, end=' ')

### FIXED CODE ###

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

l = [0]*N
for i,a in enumerate(A):
  l[a-1]=i+1
  
for x in l:
  print(x, end=' ')
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))
ans = 1
sw = 0
for i in range(n):
    ans *= a[i]
    if ans > 10**18:
        sw = 1
import collections
c = collections.Counter(a)

if sw == 1 and c[0] == 0:
    ans = -1
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
ans = 1
sw = 0
import collections
c = collections.Counter(a)
if c[0] != 0:
    ans = 0
for i in range(n):
    ans *= a[i]
    if ans > 10**18:
        ans = -1
        break
print(ans)