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

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

ans_max = 0
for i in range(n - k + 1):
    temp = 0
    for j in range(i, i + k):
        temp += (p[j] * (p[j] + 1) / 2) / p[j]

    if(ans_max < temp):
        ans_max = temp

print(ans_max)

### FIXED CODE ###

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

p_dash = []
for i in range(n):
    p_dash.append((p[i] + 1) / 2)

ans_max = 0
for i in range(k):
    ans_max += p_dash[i]

temp = ans_max
for i in range(k, n):
    temp = temp - p_dash[i - k] + p_dash[i]
    if(temp > ans_max):
        ans_max = temp

print(ans_max)
### BUGGY CODE ###

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

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

dp = [float('inf')]*n

dp[0] = 0
dp[1] = abs(arr[0]-arr[1])

for i in range(2, n):
    for j in range(i-1, max(-1, i-k-1), -1):
        dp[i] = min(dp[i], dp[j]+abs(arr[i]-arr[j]))

print(dp[-1])

### FIXED CODE ###

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

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

dp = [float('inf')]*n

dp[0] = 0
dp[1] = abs(arr[0]-arr[1])

for i in range(2, n):
    for j in range(i-1, max(-1, i-k-1), -1):
        dp[i] = min(dp[i], dp[j]+abs(arr[i]-arr[j]))

print(dp[-1])
### BUGGY CODE ###

s = input()
n = len(s)
ans = ""
for i in range(n):
  if s[i] == "?":
    ans += "D"
  else:
    ans += s[i]
print(ans)


### FIXED CODE ###

s = input()
temp = list(s)
for i in range(len(list(s))):
    if s[i] == "?":
        temp[i] = "D"
print(*temp, sep="")
### BUGGY CODE ###

def main():
    n, q = map(int, input().split())
    ab = [list(map(int, input().split())) for _ in [0]*(n-1)]
    px = [list(map(int, input().split())) for _ in [0]*q]
    g = [[] for _ in [0]*n]
    [g[a-1].append(b-1) for a, b in ab]
    [g[b-1].append(a-1) for a, b in ab]
    root = 0  # 根
    d = [-1]*n  # 根からの距離
    d[root] = 0
    q = [root]
    cnt = 0
    while q:  # BFS
        cnt += 1
        qq = []
        while q:
            i = q.pop()
            for j in g[i]:
                if d[j] == -1:
                    d[j] = cnt
                    qq.append(j)
        q = qq
    d2 = list(sorted(enumerate(d), key=lambda x: x[1]))

    ans = [0]*n
    for p, x in px:
        ans[p-1] += x
    for i, j in d2:
        for k in g[i]:
            if d[k] == j+1:
                ans[k] += ans[i]
    print(*ans)


main()

### FIXED CODE ###

n,q=map(int,input().split())
ab=[list(map(lambda x:int(x)-1,input().split())) for _ in [0]*(n-1)]
pq=[list(map(int,input().split())) for _ in [0]*q]
for i in range(q):
    pq[i][0]-=1

graph=[[] for _ in [0]*n]
[graph[a].append(b) for a,b in ab if a<b]
[graph[b].append(a) for a,b in ab if a>b]

plus=[0 for _ in [0]*n]
for i,j in pq:
    plus[i]+=j

pos=[]
ans=[0 for _ in [0]*n]
temp=0
q=[0]
memo=[False for _ in [0]*n]

while q:
    i=q.pop(-1)
    if memo[i]==False:
        pos.append(i)
        temp+=plus[i]
        ans[i]=temp
    memo[i]=True

    while graph[i]:
        j=graph[i].pop(-1)
        if memo[j]==False:
            q.append(j)
            break
    else:
        temp-=plus[pos[-1]]
        pos.pop(-1)
        if pos!=[]:
            q.append(pos[-1])
print(*ans)
### BUGGY CODE ###

n=int(input())
C=list(input()) #listにすると文字列が１文字ごとに１要素となる
cnt=0
flag1=False
flag2=True

for i in range(n):
  if C[i]=='W':
    for t in range(1,n-i):
      if C[-t]=='R':
        C[i]='R'
        C[-t]='W'
        cnt+=1
        flag2=False
        break
    if flag2:
      flag1=True
  if flag1:
    break

print(cnt)


### FIXED CODE ###

#二分探査
n=int(input())
C=list(input())
w=0
r=C.count('R')
ans=max(w,r)

for i in range(n):
  if C[i]=='W':
    w+=1
  if C[i]=='R':
    r-=1
  if ans>max(w,r):
    ans=max(w,r)
    
print(ans)


#以下のコードはO(n**2)なのでn<2*10**5では重すぎる
"""
n=int(input())
C=list(input()) #listにすると文字列が１文字ごとに１要素となる
cnt=0
flag1=False
flag2=True

for i in range(n):
  if C[i]=='W':
    for t in range(1,n-i):
      if C[-t]=='R':
        C[i]='R'
        C[-t]='W'
        cnt+=1
        flag2=False
        break
    if flag2:
      flag1=True
  if flag1:
    break

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

import sys

# import re
import math
import collections
# import decimal
import bisect
import itertools
import fractions
# import functools
import copy
import heapq
import decimal
# import statistics
import queue

# import numpy as np

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    s = input()

    l = len(s)

    cnt = [0 for _ in range(2019)]
    tmp = int(s)
    for i in range(l + 1):
        tmp %= 10 ** (l-i)
        tmp_mod = tmp % 2019
        cnt[tmp_mod] += 1

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

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys

# import re
import math
import collections
# import decimal
import bisect
import itertools
import fractions
# import functools
import copy
import heapq
import decimal
# import statistics
import queue

# import numpy as np

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    s = input()

    cnt = [0 for _ in range(2019)]
    cnt[0] += 1
    dec = 1
    num = 0
    for i in reversed(s):
        num += int(i) * dec
        num %= 2019
        dec *= 10
        dec %= 2019
        cnt[num] += 1

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

    print(ans)


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

k, s = map(int, input().split())
ans = 0
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if x+y+z==s :
                ans += 1
print(ans)

### FIXED CODE ###

k, s = map(int, input().split())
ans = 0
for x in range(k+1):
    for y in range(k+1):
        z = s - x - y
        if 0 <= z <= k :
            ans += 1
print(ans)
### BUGGY CODE ###

#!/usr/bin/env python3
S = input().strip()
N = len(S)

mod_count = {0: 1}
for mod in [int(S[i:]) % 2019 for i in range(N)]:
    mod_count[mod] = mod_count.get(mod, 0) + 1

print(sum([m * (m - 1) for m in mod_count.values()]) // 2)

### FIXED CODE ###

#!/usr/bin/env python3


def main():
    S = input()
    N = len(S)

    mod_count = [0] * 2019
    mod_count[0] = 1
    ssum = 0
    for i, c in enumerate(S[::-1]):
        ssum = (ssum + int(c) * pow(10, i, 2019)) % 2019
        mod_count[ssum] += 1

    print(sum([m * (m - 1) for m in mod_count]) // 2)


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

def dijkstra(s,n,w,cost):
    #始点sから各頂点への最短距離
    #n:頂点数,　w:辺の数, cost[u][v] : 辺uvのコスト(存在しないときはinf)
    d = [float("inf")] * n
    used = [False] * n
    d[s] = 0

    while True:
        v = -1
        #まだ使われてない頂点の中から最小の距離のものを探す
        for i in range(n):
            if (not used[i]) and (v == -1):
                v = i
            elif (not used[i]) and d[i] < d[v]:
                v = i
        if v == -1:
            break
        used[v] = True

        for j in range(n):
            d[j] = min(d[j],d[v]+cost[v][j])
    return d

################################
N = int(input())

cost = [[float("inf") for _ in range(N)] for _ in range(N)]
for _ in range(N-1):
    a, b, c = map(int, input().split())
    cost[a-1][b-1] = c
    cost[b-1][a-1] = c

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

zk = dijkstra(K-1, N, N-1, cost)
#print(zk)

for _ in range(Q):
    x, y = map(int, input().split())
    print(zk[x-1] + zk[y-1])


### FIXED CODE ###

import heapq
def dijkstra_heap(s):
    #始点sから各頂点への最短距離
    d = [float("inf")] * N
    used = [True] * N #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for e in edge[s]:
        heapq.heappush(edgelist,e)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge[1]]:
            continue
        v = minedge[1]
        d[v] = minedge[0]
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,[e[0]+d[v],e[1]])
    return d

N = int(input())

edge = [[] for i in range(N)]  # edge[i] : iから出る道の[重み,行先]の配列
for i in range(N-1):
    x,y,z = map(int,input().split())
    edge[x-1].append([z,y-1])
    edge[y-1].append([z,x-1])

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

zk = dijkstra_heap(K-1)
#print(zk)

for _ in range(Q):
    x, y = map(int, input().split())
    print(zk[x-1] + zk[y-1])
### BUGGY CODE ###

n = int(input())
attends = [int(x) for x in input().split()]
for x in range(1, n + 1):
    print(attends.index(x) + 1)


### FIXED CODE ###

n = int(input())
attends = dict(enumerate(list(map(int, input().split())), start=1))
attends_sorted = sorted(attends.items(), key=lambda x: x[1])
arr = [x[0] for x in attends_sorted]
print(*arr)
### BUGGY CODE ###

from collections import deque

h, w = map(int, input().split())
a = [list(input()) for _ in range(h)]

cnt = [[10 ** 10] * w for _ in range(h)]
for i in range(h):
    for j in range(w):
        if a[i][j] == "#":
            cnt[i][j] = 0
def bfs(q, v, c):
    while q:
        y, x = q.pop()
        for i, j in ([0, 1], [1, 0], [-1, 0], [0, -1]):
            ny = y + i
            nx = x + j
            if 0 <= nx < w and 0 <= ny < h and v[ny][nx] == 0:
                v[ny][nx] = 1
                if c[ny][nx] >= c[y][x] + 1:
                    c[ny][nx] = c[y][x] + 1
                    q.append([ny, nx])





for i in range(h):
    for j in range(w):
        if a[i][j] == "#":
            queue = deque()
            queue.append([i, j])
            visited = [[0] * w for _ in range(h)]
            bfs(queue, visited, cnt)
            """
            for k in range(h):
                print(cnt[k])
            print()
            """
ans = 0
for i in range(h):
    ans = max(ans, max(cnt[i]))
print(ans)

### FIXED CODE ###

from collections import deque

h, w = map(int, input().split())
a = [list(input()) for _ in range(h)]

cnt = [[10 ** 10] * w for _ in range(h)]
visited = [[0] * w for _ in range(h)]
queue = deque()
for i in range(h):
    for j in range(w):
        if a[i][j] == "#":
            cnt[i][j] = 0
            queue.append([i, j])
            visited[i][j] = 1

def bfs(q, v, c):
    while q:
        y, x = q.popleft()
        for i, j in ([0, 1], [1, 0], [-1, 0], [0, -1]):
            ny = y + i
            nx = x + j
            if 0 <= nx < w and 0 <= ny < h and v[ny][nx] == 0:
                c[ny][nx] = c[y][x] + 1
                v[ny][nx] = 1
                q.append([ny, nx])

bfs(queue, visited, cnt)

ans = 0
for i in range(h):
    ans = max(ans, max(cnt[i]))
print(ans)
### BUGGY CODE ###

#### import ####
import sys
import math
from collections import defaultdict

#### 設定 ####
sys.setrecursionlimit(10**7)

#### 定数 ####
mod = 10**9 + 7

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
  read_all = [tuple(map(int, input().split())) for _ in range(N)]
  return map(list,zip(*read_all))

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

from scipy import sparse

import numpy as np
S = str(input())
N = len(S)
A = np.matrix([[0]*N for _ in range(N)])
for i in range(N):
  if S[i]=='R':
    A[i,i+1] = 1
  else:
    A[i,i-1] = 1

x = sparse.lil_matrix(np.array([1]*N)) * sparse.lil_matrix(np.linalg.matrix_power(A,10**100))
x = x.toarray()
a = []
for i in range(N):
  a.append(x[0,i])
print(*a)

### FIXED CODE ###

#### import ####
import sys
import math
from collections import defaultdict

#### 設定 ####
sys.setrecursionlimit(10**7)

#### 定数 ####
mod = 10**9 + 7

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
  read_all = [tuple(map(int, input().split())) for _ in range(N)]
  return map(list,zip(*read_all))

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

S = str(input())
n = len(S)
ans = [0]*n

left = 0
while left<=n-1:
  R_pos = n-1
  for i in range(left,n):
    if S[i]=='L':
      R_pos = i-1
      L_pos = i
      break
  if R_pos == n-1:
    ans[R_pos] += R_pos-left + 1
    break
  right = n-1
  for j in range(i+1,n):
    if S[j] == 'R':
      right = j-1
      break
  ans[R_pos] += (R_pos-left)//2 + (right-R_pos)//2 + 1
  ans[L_pos] += (L_pos-left)//2 + (right-L_pos)//2 + 1
  if right == n-1:
    break
  left = j

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

from collections import deque

def bfs(start, goal):
    queue = deque([start])
    visited = []

    while queue:
        label = queue.pop()

        if label not in visited:
            visited.append(label)
            #if label == goal:
            #    return

            for v in d[label]:
                #if v not in visited:
                tekazu[v] = tekazu[label] + 1
                queue.appendleft(v)

    return

n = int(input())
d = {i: [] for i in range(n)}

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

tekazu = [float("inf") for _ in range(n)] # nは頂点数
tekazu[0] = 0
bfs(0, n - 1)
tekazu_Fennec = tekazu

tekazu = [float("inf") for _ in range(n)] # nは頂点数
tekazu[-1] = 0
bfs(n - 1, 0)
tekazu_Snuke = tekazu

Fennec = 0
Snuke = 0

for i in range(n):
    if tekazu_Fennec[i] <= tekazu_Snuke[i]:
        Fennec += 1
    else:
        Snuke += 1

#print(tekazu_Fennec, tekazu_Snuke)

if Fennec > Snuke:
    print("Fennec")
else:
    print("Snuke")

### FIXED CODE ###

from collections import deque

def bfs(start):
    queue = deque([start])
    visited = []

    while queue:
        label = queue.pop()

        #if label not in visited:
        visited.append(label)

        for v in d[label]:
            if tekazu[v] == float("inf"):
                tekazu[v] = tekazu[label] + 1
                queue.appendleft(v)

    return

n = int(input())
d = [[] for _ in range(n)]

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

tekazu = [float("inf") for _ in range(n)] # nは頂点数
tekazu[0] = 0
bfs(0)
tekazu_Fennec = tekazu

tekazu = [float("inf") for _ in range(n)] # nは頂点数
tekazu[-1] = 0
bfs(n - 1)
tekazu_Snuke = tekazu

Fennec = 0
Snuke = 0

for i in range(n):
    if tekazu_Fennec[i] <= tekazu_Snuke[i]:
        Fennec += 1
    else:
        Snuke += 1

#print(tekazu_Fennec, tekazu_Snuke)

if Fennec > Snuke:
    print("Fennec")
else:
    print("Snuke")
### BUGGY CODE ###

n=int(input())
ans =0
L =[0]*n

for i in range(1,n+1):
    for j in range(1,int(n**0.5//6)+2):
        for k in range(j,int(n**0.5//6)+3):
            for l in range(k,int(n**0.5//6)+4):
                if j**2 + k **2 + l**2 + j*k + k*l + l*j == i:
                    if j == k == l:
                        L[i-1] += 1
                        break
                    if j < k <l:
                        L[i-1] += 6
                        break
                    else:
                        L[i-1] += 3
for m in range(n):
    print(L[m])

### FIXED CODE ###

N=int(input())
r=[0]*10000
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            v = i*i + j*j + k*k + i*j + i*k + k*j
            if v <= 10000:
                r[v-1] += 1
for i in range(N):
    print(r[i])
### BUGGY CODE ###

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

import numpy

def lcs(s, t):
  dp = [['' for _ in range(len(t)+1)] for _ in range(len(s)+1)]
  for i, si in enumerate(s, 1):
    for j, tj in enumerate(t, 1):
      dp[i][j] = max([(dp[i-1][j-1]+si) if si==tj else '', dp[i-1][j], dp[i][j-1]], key=lambda x: len(x))
  return dp[-1][-1]

def main():
  s = input().strip()
  t = input().strip()
  print(lcs(s, t))


if __name__=='__main__':
  main()

### FIXED CODE ###

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

# @profile
def calc_lcs(s, t):
  dp = [[0 for _ in range(len(t)+1)] for _ in range(len(s)+1)]
  # dp = numpy.zeros((len(s)+1, len(t)+1))
  for i, si in enumerate(s, 1):
    for j, tj in enumerate(t, 1):
      dp[i][j] = max((dp[i-1][j-1] + 1) if si==tj else 0, dp[i-1][j], dp[i][j-1])

  lcs = ''
  i, j = len(s), len(t)
  while i > 0 and j > 0:
    if dp[i][j] == dp[i-1][j]:
      i -= 1
    elif dp[i][j] == dp[i][j-1]:
      j -= 1
    else:
      lcs = s[i-1] + lcs
      i -= 1
      j -= 1
  return lcs

def main():
  s = input().strip()
  t = input().strip()
  print(calc_lcs(s, t))


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

import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from itertools import accumulate #list(accumulate(A))

H, W = mi()
S = [li() for _ in range(H)]
flag = [[0]*W for _ in range(H)]
flag_odd = [[0]*W for _ in range(H)]
odd_l = []

for i in range(H):
    for j in range(W):
        if S[i][j] % 2:
            odd_l.append([i, j, i+j])
            flag_odd[i][j] = 1

odd_l = sorted(odd_l, key = lambda x:x[2])

#print(odd_l)
num_odd = len(odd_l)

ans = []
for si, sj, _ in odd_l[:(num_odd//2)*2]:
    #si, sj = odd_l[2*i][0], odd_l[2*i][1]
    #ti, tj = odd_l[2*i+1][0], odd_l[2*i+1][1]
    if not flag_odd[si][sj]:
        continue
    flag_odd[si][sj] = 0
    flag[si][sj] = 1
    while True:
        if si+1 < H and not flag[si+1][sj]:
            si += 1
            flag[si][sj] = 1
            ans.append([si-1, sj, si, sj])
        if sj+1 < W and not flag[si][sj+1]:
            sj += 1
            flag[si][sj] = 1
            ans.append([si, sj-1, si, sj])
        if flag_odd[si][sj] == 1:
            flag_odd[si][sj] = 0
            break

print(len(ans))
for si, sj, ti, tj in ans:
    print(si+1, sj+1, ti+1, tj+1)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from itertools import accumulate #list(accumulate(A))

H, W = mi()
S = [li() for _ in range(H)]
f = 0
ans = []

for j in range(W):
    if not j%2:
        for i in range(H):
            if f:
                ans.append([pi, pj, i+1, j+1])
            if S[i][j] % 2:
                f = 1 - f
            pi, pj = i+1, j+1
    if j%2:
        for i in reversed(range(H)):
            if f:
                ans.append([pi, pj, i+1, j+1])
            if S[i][j] % 2:
                f = 1 - f
            pi, pj = i+1, j+1


N = len(ans)
print(N)
for i in range(N):
    print(ans[i][0], ans[i][1], ans[i][2], ans[i][3])
### BUGGY CODE ###

#!/usr/bin/env python3

import sys

def dfs(i, p, add):
    add += add_node[i]
    counter[i] += add
    for j in adj[i]:
        if j != p:
            dfs(j, i, add)

sys.setrecursionlimit(10 ** 6)
n, q = map(int, input().split())
adj = [[] for i in range(n)]
for i in range(n - 1):
    a, b = map(int, input().split())
    adj[a - 1].append(b - 1)
    adj[b - 1].append(a - 1)
add_node = [0 for i in range(n)]
for i in range(q):
    p, x = map(int, input().split())
    add_node[p - 1] += x
counter = [0 for i in range(n)]
dfs(0, -1, 0)
print(" ".join(str(x) for x in counter))



### FIXED CODE ###

#!/usr/bin/env python3

import sys

def dfs(i, p, add):
    add += add_node[i]
    counter[i] += add
    for j in adj[i]:
        if j != p:
            dfs(j, i, add)

sys.setrecursionlimit(10 ** 6)
n, q = map(int, input().split())
adj = [[] for i in range(n)]
for i in range(n - 1):
    a, b = map(int, sys.stdin.readline().split())
    adj[a - 1].append(b - 1)
    adj[b - 1].append(a - 1)
add_node = [0 for i in range(n)]
for i in range(q):
    p, x = map(int, sys.stdin.readline().split())
    add_node[p - 1] += x
counter = [0 for i in range(n)]
dfs(0, -1, 0)
print(" ".join(str(x) for x in counter))
### BUGGY CODE ###

import sys
INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
LIST = lambda: list(map(int, INPUT().split()))
sys.setrecursionlimit(10 ** 9)
 
 
def main():
    N = INT()
    H = LIST()
 
    ans = 0
    for i in range(N-1):
        cnt = 0
        for j in range(i, N-1):
            if H[j] >= H[j+1]: cnt += 1
            else: break
        if ans < cnt: ans = cnt
 
    print(ans)
 
 
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
LIST = lambda: list(map(int, INPUT().split()))
sys.setrecursionlimit(10 ** 9)


def main():
    N = INT()
    H = LIST()

    D = [0]
    idx = 0
    for i in range(N-1):
        if H[i] >= H[i+1]: D[idx] += 1
        else:
            idx += 1
            D.append(0)

    print(max(D))


if __name__ == '__main__':
    main()