Harryxun/stf_run huggingface dataset:
# -*- coding: utf-8 -*-
def inpl(): return list(map(int, input().split()))
from copy import deepcopy

N, K = inpl()
A = sorted(inpl(), reverse=True)

DP = [False for _ in range(K)]
DP[0] = 1
OK = [False for _ in range(N)]

for i, a in enumerate(A):
    DP0 = deepcopy(DP)
    if a >= K:
        OK[i] = True
        continue
    for j, d in enumerate(DP0):
        if d:
            if j + a >= K:
                OK[i] = True
                break
            else:
                DP[j+a] = True

if sum(OK) == 0:
    print(N)
else:
    print(OK[::-1].index(True))  

### FIXED CODE ###

# -*- coding: utf-8 -*-
def inpl(): return list(map(int, input().split()))
from math import ceil

X = int(input())
print(ceil((2*X+1/4)**(1/2) - 1/2))
A, B, C = list(map(int, input().split()))
if A[len(A)-1] == B[0] and B[len(B)-1] == C[0]:
    print("YES")
else:
    print("No")

### FIXED CODE ###

A, B, C = list(map(str, input().split()))
if A[len(A)-1] == B[0] and B[len(B)-1] == C[0]:
    print("YES")
else:
    print("NO")
import sys #追加

n=int(input())
sys.setrecursionlimit(10**6*2)

s=input()
X=int(s,2)
ans=[]

ans_memo=[0]*(2**(n+2))
#print(ans_memo)
ans_memo[1]=1
ans_memo[2]=1

def DEF(x,cnt):
    global ans_memo
    #print(x,cnt,ans_memo)
    if x==0:
        return 0    
    if ans_memo[x]!=0:
        return ans_memo[x]
    else:
        if x%(str(bin(x)).count("1"))==0:
            ans_memo[x]=1
            return 1
        else:
            tmp=DEF(x%(str(bin(x)).count("1")),cnt+1)+1
            ans_memo[x]=tmp
            return tmp

ans=[]

for i in range(n):
    tmp=2**(n-i-1)
    tmp_num=X
    #1の時
    if tmp&tmp_num:
        tmp_num-=tmp
        #print(bin(tmp_num),n-i-1)
        ans.append(DEF(tmp_num,0))
        
    else:
        tmp_num+=tmp
        #print(bin(tmp_num),n-i-1)
        ans.append(DEF(tmp_num,0))

#print(ans_memo)

for item in ans:
    print(item)
            









### FIXED CODE ###

def popcount(x):
    return bin(x).count("1")

n=int(input())
s=input()
X=int(s,2)

one_cnt=popcount(X)

modp=X%(one_cnt+1)
modm=X%(one_cnt-1) if one_cnt-1!=0 else 0

for i in range(n):
    if s[i]=="1":
        if one_cnt-1==0:
            print(0)
            continue
        else:
            num=(modm-pow(2,n-i-1,one_cnt-1))%(one_cnt-1)
    else:
        num=(modp+pow(2,n-i-1,one_cnt+1))%(one_cnt+1)

    #print(i,"num",num)
    cnt=1
    while num!=0:
        num=num%popcount(num)
        cnt+=1
    print(cnt)
num = int(input())
box = []
for i range(num):
  box.append(1/int(input()))
print(1/sum(box))

### FIXED CODE ###

num = int(input())
box1 = [int(s) for s in input().split()]
box = []
for i in box1:
  box.append(1/i)
print(1/sum(box))
n, m = map(int, input().split())
edges = [[] for i in range(m)]
for i in range(m):
    a, b = map(int, input().split())
    edges[a - 1].append(b - 1)

from collections import deque

q = deque()

prev = [-1] * n

q.append(0)
while q:
    v = q.pop()
    for e in edges[v]:
        if prev[e] != -1:
            continue
        prev[e] = v
        q.append(e)

print("Yes")
for val in prev[1:]:
    print(val + 1)


### FIXED CODE ###

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

from collections import deque

q = deque()

prev = [-1] * n

q.append(0)
while q:
    v = q.popleft()
    for e in edges[v]:
        if prev[e] != -1:
            continue
        prev[e] = v
        q.append(e)

print("Yes")
for val in prev[1:]:
    print(val + 1)
import math
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result



mod=1000000007
X,Y=map(int,input().split())
flag=0
count=0
for i in range(min(X,Y)//3):
    if min(X,Y)*2==max(X,Y):
        flag=1
        count2=min(X,Y)
        break
    X-=3
    Y-=3
    count+=1
    #print(X,Y)

if min(X,Y)*2==max(X,Y):
    flag=1

if flag==0:
    print('0')
    exit(0)

print(cmb(count*2+count2,count)%mod)



### FIXED CODE ###

import math
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result


count2=0
mod=1000000007
X,Y=map(int,input().split())
flag=0
count=0
for i in range(min(X,Y)//3):
    if min(X,Y)*2==max(X,Y):
        flag=1
        count2=min(X,Y)
        break
    X-=3
    Y-=3
    count+=1
    #print(X,Y)

if min(X,Y)*2==max(X,Y):
    flag=1

if flag==0:
    print('0')
    exit(0)

print(cmb(count*2+count2,count)%mod)
s = input()

if s = 'ABC':
    print('ARC')
else:
    print('ABC')

### FIXED CODE ###

s = input()

if s == 'ABC':
    print('ARC')
else:
    print('ABC')
line1 = list(raw_input())
line2 = list(raw_input())
overall = list1 + list2

gyaku = overall[::-1]

if overall == gyaku:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

line1 = list(input())
line2 = list(input())
overall = line1 + line2

gyaku = overall[::-1]

if overall == gyaku:
    print("YES")
else:
    print("NO")
mod = 10**9 + 7
def cmb(n,r,mod):
	a=1
	b=1
	r = min(r,n-r)
	for i in range(r):
		a = a*(n-i)%mod
		b = b*(i+1)%mod
	return a*pow(b,mod-2,mod)%mod

N = int(input())
march = []
for _ in range(N):
  H =str(input())
  if H[0] == 'M' or H[0] == 'A' or H[0] == 'R' or H[0] == 'C' or H[0] == 'H':
    march.append(H[0])
march = ''.join(march)
m = march.count('M')
a = march.count('A')
r = march.count('R')
c = march.count('C')
h = march.count('H')
l = [m,a,r,c,h]
L = []
for i in range(len(l)):
  if l[i] > 0:
    L.append(l[i])
if L == []:
  print(0)
else:
  ans = cmb(len(L),3,mod)
  for i in range(len(L)):
    if L[i] > 1:
      ans = ans*L[i]-(len(L)-3)
print(ans)

### FIXED CODE ###

from itertools import *
N = int(input())
march = []
for _ in range(N):
  H =str(input())
  if H[0] == 'M' or H[0] == 'A' or H[0] == 'R' or H[0] == 'C' or H[0] == 'H':
    march.append(H[0])
march = ''.join(march)
m = march.count('M')
a = march.count('A')
r = march.count('R')
c = march.count('C')
h = march.count('H')
l = [m,a,r,c,h]
L = []
for i in range(len(l)):
  if l[i] > 0:
    L.append(l[i])
if len(L) < 3:
  print(0)
  exit()
else:
  ans = 0
  for l in combinations(L,3):
    a,b,c = l
    ans += (a*b*c)
    
print(ans)
N, K, Q = map(int, input().split())
A = [int,input() for i in range(Q)]
point_list = [K]*N
for answer in A:
    point_list = list(map(lambda x: x-1, point_list))
    point_list[answer-1] += 1
    
for ans in point_list:
    if ans > 0:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

N, K, Q = map(int, input().split())
A = [int(input()) for i in range(Q)]
seikaisuu = [0]*N
for answer in A:
    seikaisuu[answer-1] += 1
for x in seikaisuu:
    if K > Q - x:
        print("Yes")
    else:
        print("No")
# -*- coding: utf-8 -*-
import sys
import copy
sys.setrecursionlimit(10000000)

H,W,K=map(int, raw_input().split())
S=[ list(raw_input()) for _ in range(H)]

L=[ [] for _ in range(H) ]
ng=[]

cnt=0
ichigo=False
for h in range(H):
    cnt+=1
    ichigo=False
    for w in range(W):
        if S[h][w]=="#":
            if ichigo:
                cnt+=1      ##該当行でイチゴの出現が2回目以降の時は、カウントを増やす
            else:
                ichigo=True #該当行でイチゴの出現が1回目の時はTrueを入れる
        L[h].append(cnt)
    else:
        if ichigo is False:
            ng.append(h) #イチゴが１つも入ってない行番号



def func(n,str):   #行番号 方向 u:up d:down
    #print "func(",n,",",str,")"
    if n in ng:
        if 0<=n-1: func(n-1,"u")
        if n+1<=H-1: func(n+1,"d")
    else:      #NG行でない場合
        if str=="u":
            if n+1<=H-1:
                L[n+1]=copy.deepcopy(L[n])
        elif str=="d":
            if 0<=n-1:
                L[n-1]=copy.deepcopy(L[n])

#1行にイチゴが1つもない行に対して、前or後の行をコピーする処理
for x in ng:
    func(x,"u")
    func(x,"d")


#1,2,3...Kの順で再度ピースの番号を振り直す
D={}    #前のピース番号：後のピース番号のマッピング辞書配列

cnt=1
for h in range(H):
    for w,x in enumerate(L[h]):
        if x not in D:  #辞書内になかった場合は、辞書に登録してカウンターの数字を+1する
            D[x]=cnt
            L[h][w]=cnt
            cnt+=1
        else:
            L[h][w]=D[x]  #辞書内にあった場合は、その値を使用


for h in range(H):
    for x in L[h]:
        print x,
    print

### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
from collections import deque,defaultdict
sys.setrecursionlimit(10**5)

H,W,K=map(int, sys.stdin.readline().split())
ichigo=[]
cnt=0
h_visit=[0 for h in range(H)]  #縦軸にイチゴがない箇所は0、ある箇所は1

L=[ [] for h in range(H) ]
for h in range(H):
    s=sys.stdin.readline().strip()
    for w,x in enumerate(s):
        if x==".":
            L[h].append(0)
        elif x=="#":
            cnt+=1
            L[h].append(cnt)
            ichigo.append((h,w))
            h_visit[h]=1


D=(1,-1)

def yoko_dfs(h,w):  #縦座標、横座標
    for dw in D:
        if 0<=w+dw<=W-1 and L[h][w+dw]==0:
            L[h][w+dw]=L[h][w]
            yoko_dfs(h,w+dw)
    return

for h,w in ichigo:
    yoko_dfs(h,w)


def tate_dfs(h):  #縦座標
    for dh in D:
        if 0<=h+dh<=H-1:
            if h_visit[h+dh]==1: continue
            h_visit[h+dh]=1 #訪問済みにする
            L[h+dh]=L[h]
            tate_dfs(h+dh)

for h,w in ichigo:
    tate_dfs(h)

for l in L:
    for x in l:
        print x,
    print
N=int(input())
b=set()
for i in range(N):
    a=input()
    if  a in b:
        b.remove(a)
    else:
        b.add(a)
print(len(b))

### FIXED CODE ###

if "9" in input():
    print("Yes")
else:print("No")
# coding: utf-8
N, S = list(map(int, input().split()))
A = [0] + list(map(int, input().split()))

dp = [[0 for _ in range(S+2)] for i in range(N+1)]

for k in range(0, N):
  for s in range(0, S+1):
    dp[k+1][s] += 2 * dp[k][s] - dp[k-1][s]
  if S > A[k+1]:
    for s in range(1,S-A[k+1]+1):
      dp[k+1][s+A[k+1]] += dp[k][s] - dp[k-1][s]
  dp[k+1][A[k+1]] += k+1

print(dp[N][S])

### FIXED CODE ###

# coding: utf-8
import numpy as np
N, S = list(map(int, input().split()))
A = [0]+list(map(int, input().split()))

dt = np.array([[0 for _ in range(S+1)] for x in range(N+1)])

for n in range(1, N+1):
  if A[n] <= S:
    dt[n,A[n]] += n
  if A[n] < S:
    dt[n, A[n]+1:] += dt[n-1,1:S-A[n]+1] - dt[n-2,1:S-A[n]+1]
  dt[n,:] += dt[n-1,:] * 2 - dt[n-2,:]
  dt[n,:] %= 998244353
print(dt[N,S] % 998244353)
N=int(input())
s=[]
for i in range(N):
    s.append(input())
print("AC x ",s.count("AC"))
print("WA x ",s.count("WA"))
print("TLE x ",s.count("TLE"))
print("RE x ",s.count("RE"))

### FIXED CODE ###


n=int(input())
if n%1000==0:
    print('0')
else:
    k = n
    k += 1000
    k //= 1000
    cha = k*1000-n
    print(cha)
N = input()
a_list = [int(i) for i in input().split(' ')]
mod = 1000000007
 
sum = 0
for i in a_list:
  sum += i

output_sum = 0
for idx, i in enumerate(a_list[:-1]):
  sum -= a_list[idx]
  output_sum += i*sum
  
print(output_sum%mod)

### FIXED CODE ###

D,T,S = [int(i) for i in input().split(' ')]
 
if T*S >= D:
  print('Yes')
else:
  print('No')
x, y = gets.split(" ").map(&:to_i)
def rating_try(x, y)
  if x < 10
     y+(100*(10-x))
  else
     y
  end
end
puts rating_try(x, y)


### FIXED CODE ###

x, y = map(int, input().split())
if x >= 10:
    print(y)
else:
    print(y+100*(10-x))
MAX = 100002

def add_num(nn, x):
    if nn == -1:
        return
    Tree[nn][0] += x
    for ni in Tree[nn][1]:
        add_num(ni, x)


ipt = input().split()
N = int(ipt[0])
Q = int(ipt[1])



Tree = []
for m in range(MAX-1):
    Tree.append([-1, [-1]])

nodes = set()
nodes.add(1)

for i in range(N-1):
    ipti = input().split()
    a = int(ipti[0])
    b = int(ipti[1])

    Tree[a][0] = 0
    Tree[a][1].insert(0, b)
    Tree[b][0] = 0

    nodes.add(b)



for i in range(Q):
    ipti = input().split()
    p = int(ipti[0])
    x = int(ipti[1])

    cands = set()

    Tree[p][0] += x

    for pi in range(p,MAX-1):
        if Tree[pi] == -1:
            break
        for pii in Tree[pi][1]:
            cands.add(pii)
    for ci in cands:
        Tree[ci][0] += x

    #add_num(p, x)


for n in nodes:
    print(Tree[n][0])








### FIXED CODE ###

ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
import sys

sys.setrecursionlimit(500000)

visited = set()

n,q = nm()

tval = [0]*n
t = [[] for _ in range(n)]

for i in range(n-1):
    a,b = nm()
    t[a-1].append(b-1)
    t[b-1].append(a-1)

for i in range(q):
    p,x = nm()
    tval[p-1] += x

ans = [0]*n
def dfs(num,val):
    visited.add(num)
    now = val+tval[num]
    ans[num] = now
    for nn in t[num]:
        if nn not in visited:
            dfs(nn,now)

dfs(0,0)

for i in ans:
    print(i)
N, Y = map(int, input().split())

x=-1
y=-1
z=-1

Ten=10000
Five=5000
One=1000

count=0

max_x=int(Y//Ten)

if max_x <= N:
	for i in reversed(range(0,max_x+1)):
		if count ==0:
			max_y = int((Y - Ten*i)//Five)
			if (max_y + i) <= N:
				for j in reversed(range(0, max_y+1)):
					if (Ten*j + Five*i + One*(N-i-j))==Y:
						x=i
						y=j
						z=max_z
						count+=1
						break

print(x, y, z)

### FIXED CODE ###

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

x=-1
y=-1
z=-1

Ten=10000
Five=5000
One=1000

count=0

max_x=int(Y//Ten)

if max_x <= N:
	for i in reversed(range(0,max_x+1)):
		if count == 1:
			break
		elif count == 0:
			max_y = int((Y - Ten*i)//Five)
			if (max_y + i) <= N:
				for j in reversed(range(0, max_y+1)):
					if (Ten*i + Five*j + One*(N-i-j))==Y:
						x=i
						y=j
						z=N - i - j
						count+=1
						break

print(x, y, z)
S=raw_input()
print S/3600:(S%3600)/60:S-(S%3600)/60

### FIXED CODE ###

S=input()
 
print str(S/3600)+':'+str((S%3600)/60)+':'+str(S%60)
N = int(input())
a = []
if N == 0:
  a.append["0"]
while N != 0:
  a.append(str(N % 2))
  N = -(N // 2)
print("".join(reversed(a)))

### FIXED CODE ###

N = int(input())
a = []
if N == 0:
    a = ["0"]
while N != 0:
    a.append(str(N % 2)) # N mod 2
    N = -(N - N % 2) // 2 # (N − (N mod 2)) // 2
print("".join(list(reversed(a))))
n=int(input())
a=list(map(int,input().split()))
if not 1 in a:
    print(-1)
else:
    for i in range(1,n):
        if i in a:
            index=a.index(i)
            a=a[index:]
        else:
            break
    print(n-i+1)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
now=1
rtn=0
for i in range(n):
    if a[i]==now:
        rtn+=1
        now+=1
if rtn:
    print(n-rtn)
else:
    print(-1)
from itertools import combinations as cc

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

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

total=0
mod = 10**9+7
for i in list(cc(a,k)):
	maxx=max(i)%mod
	minx=min(i)%mod
	total=(total%mod+(maxx-minx)%mod)%mod
	
print(total)



### FIXED CODE ###

s=input()
print(chr(ord(s)+1))
x = input()
inputs = x.split()
a, b, c = int(inputs[0]), int(inputs[1]), int(inputs[2])
if a = b and b = c:
  return 'Yes'
else:
  return 'No'

### FIXED CODE ###

x = input()
inputs = x.split()
a, b, c = int(inputs[0]), int(inputs[1]), int(inputs[2])

if a == b and b == c:
    print('Yes')
else:
    print('No')
n,w=list(map(int,input().split()))
a=[]
for i in range(n):
    a.append(list(map(int,input().split())))
a.sort()
b=[]
for i in range(n):
    b.append([0]*(w+1))
for i in range(1,w+1):
    if i>=a[0][0]:
        b[0][i]=a[0][1]
 
for i in range(1,n):
    for j in range(1,w+1):
        if j>=a[i][0]:
            b[i][j]=max(b[i-1][j],b[i-1][j-a[i][0]]+a[i][1])
        else:
            b[i][j]=b[i-1][j]
print(b[n-1][w])

### FIXED CODE ###

import numpy as np
N,W = map(int,input().split())
V_sum = 0
w_l = []
v_l = []
for i in range(N):
    w,v = list(map(int,input().split()))
    V_sum+=v
    w_l.append(w)
    v_l.append(v)
dp = np.full(V_sum+1,W+1)
dp[0] = 0
for i in range(N):
    dp[v_l[i]:] = np.minimum(dp[v_l[i]:],dp[:-v_l[i]]+w_l[i])
for i in range(V_sum,-1,-1):
    if dp[i]<=W:
        print(i)
        break
n, Y = list(map(int, input().split()))
for i in range(N + 1):
    for j in range(n + 1 - i):
        if 10000 * i + 5000 * j + 1000 * (n - i - j) == Y:
            print(i, j, n - i - j)
            exit()
else:
    print('-1 -1 -1')


### FIXED CODE ###

n, Y = list(map(int, input().split()))
for i in range(n + 1):
    for j in range(n + 1 - i):
        if 10000 * i + 5000 * j + 1000 * (n - i - j) == Y:
            print(i, j, n - i - j)
            exit()
else:
    print('-1 -1 -1')
import math
A, B = map(int, input().split())

n = math.gcd(A, B)


if n == 1:
    print(1)
else:
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            while temp%i == 0:
                temp //= i
            arr.append(i)
    if temp != 1:
        arr.append(temp)

    print(len(arr)+1)


### FIXED CODE ###


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

while B:
    A, B = B, A % B
n = A



if n == 1:
    print(1)
else:
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            while temp%i == 0:
                temp //= i
            arr.append(i)
    if temp != 1:
        arr.append(temp)

    print(len(arr)+1)
sum = 0
N = input() 
for i in range(N):
	s = input()
	sum += 1/s
print(sum)

### FIXED CODE ###

sum = 0.00
s = 0 
N = int(input()) 
numlist = list(input().split())
for i in range(N):
	s = int(numlist[i])
	sum = sum+(1/s)
print(1/sum)
n, k = map(int, input().split())

data = list(map(int, input().split() ))
data.sort()
print(sum(data[0:k]))

### FIXED CODE ###

x = input()

if x.isupper():
	print("A")
else:
  	print("a")
s = [input() for i in range(6)]
if s[5]-s[0] < s[6]:
  print("Yay!")
else:
  print(":(")

### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

if e-a <= k:
  print("Yay!")
else:
  print(":(")
n = int(input())
a = list(map(int, input().split()))
a.sort()
if n == 2:
    print(a[1])
else:
    dif = set()
    for i in range(n - 1):
        dif.append(a[i - 1] - a[i])
    d = list(dif)
    d.sort()
    d.reverse()
    f=False
    for i in range(len(d)):
        if d[i] == 0:
            break
        ok = True
        flag = False
        for j in range(n):
            if a[j] % d[i] != 0:
                if flag:
                    break
                else:
                    ok=False
        if ok:
            f=True
            print(i)
            break
    if not f:
        print(1)

### FIXED CODE ###

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

from fractions import gcd

tl = [a[0]]
for i in range(1, n):
    tl.append(gcd(tl[i - 1], a[i]))

tr = [a[n - 1]]
for i in range(1, n):
    tr.append(gcd(tr[i - 1], a[n - 1 - i]))
tr.reverse()

ans = 1
for i in range(n):
    tmp = 1
    if i == 0: tmp = tr[i + 1]
    elif i == n - 1: tmp = tl[i - 1]
    else: tmp = gcd(tl[i - 1], tr[i + 1])
    ans = max(ans, tmp)
print(ans)
N = int(input())
print(f"ABC{N}")


### FIXED CODE ###

N = int(input())
print("ABC"+str(N))
h, n = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
dp =[0]*(h+max(ab[0:n][1]))
for i in range(1, h+1):
  dp[i] = min(dp[i-a]+b for a,b in ab)
print(dp[h])

### FIXED CODE ###

def main():
    h, n = map(int, input().split())
    ab = [list(map(int, input().split())) for _ in range(n)]
    dp =[0]*(h+max(a for a,b in ab))
    for i in range(1, h+1):
        dp[i] = min(dp[i-a]+b for a,b in ab)
    print(dp[h])
      
if __name__ == '__main__':
    main()
import sys
import numpy as np
N = int(sys.stdin.readline())
A = np.farray(sys.stdin.readline().split(), dtype=np.int32)

"""
A = [10,4,8,7,3]
is_left_end = [1,0,1,0,0]
left_idx = [0,0,2,2,2]
というものを作る
"""
is_left_end = np.empty(N, dtype=np.bool)
is_left_end[0] = 1
is_left_end[1:] = (A[1:] > A[:-1])


left_idx = np.where(is_left_end, np.arange(N), 0) # [0,0,2,0,0]
np.maximum.accumulate(left_idx, out=left_idx) # [0,0,2,2,2]

answer = (np.arange(N) - left_idx).max()
print(answer)


### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

N = int(input())
H = [int(x) for x in input().split()]

score = [0]*N
for n in range(N-2,-1,-1):
    if H[n] >= H[n+1]:
        score[n] = score[n+1] + 1

print(max(score))
if a%2==1 or b%2==1 or c%2==1:
    print(f)
elif a==b and b==c:
    f=-1
    print(f)
else:
    while a%2==0 and b%2==0 and c%2==0:
        A=a
        B=b
        C=c
        a=B//2+C//2
        b=A//2+C//2
        c=A//2+B//2
        f=f+1
    else:
        print(f)

### FIXED CODE ###

a,b,c = list(map(int, input().strip().split()))
f=0
if a%2==1 or b%2==1 or c%2==1:
    print(f)
elif a==b and b==c:
    f=-1
    print(f)
else:
    while a%2==0 and b%2==0 and c%2==0:
        A=a
        B=b
        C=c
        a=B//2+C//2
        b=A//2+C//2
        c=A//2+B//2
        f=f+1
    else:
        print(f)
a=input().split()
N,A,B=int(a[0]),int(a[1]),int(a[2])
st_a='b'*A
st_b='r'*B
d=st_a+st_b
e=A+B
if(e==0):
  print(0)
else:
  num=int(N/e)+2
  b=d*num
  print(b)
  c=b[0:N]
  print(c)
  print(c.count('b'))

### FIXED CODE ###

a=input().split()
N,A,B=int(a[0]),int(a[1]),int(a[2])
b=int(N/(A+B))
ans=int(A*b)
if(N-b*(A+B)<=A):
    ans=ans+N-b*(A+B)
else:
    ans+=A
print(int(ans))
N = input()
A = input()
 
if(N % 500 <= A):
  print("Yes/n")
else:
  print("No/n")

### FIXED CODE ###

N = int(input())
A = int(input())
 
if(N % 500 <= A):
  print("Yes")
else:
  print("No")
# -*- coding: utf-8 -*-

n, m = map(int, input().split())
A = {}
for i in range(m):
    data = list(map(int, input().split()))
    if data[0] not in A:
        A[data[0]] = 1
    else:
        A[data[0]] += 1
    if data[1] not in A:
        A[data[1]] = 1
    else:
        A[data[1]] += 1

for i in range(1, n+1):
    print(A[i])


### FIXED CODE ###

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

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

A = {}
for i in range(1, n+1):
    A[i] = 0
for i in range(m):
    data = list(map(int, input().split()))
    A[data[0]] += 1
    A[data[1]] += 1

for i in range(1, n+1):
    print(A[i])
from math import sqrt

while True:
    e = int(raw_input())
 
    if e == 0: break

    x, y, z, ans = 0, 0, 0, e

    for z in range(e):
        if z**3 > e: break
        y = int(sqrt(e - z**3))
        x = e - y**2 - z**3
        ans = min(ans, x+y+z)

    print ans



### FIXED CODE ###

#!/usr/bin/env python3

from math import sqrt

while True:
    e = int(input())

    if e == 0: break
    z, ans = 0, e

    while z ** 3 <= e:
        y = int(sqrt(e - z**3))
        x = e - y**2 - z**3
        ans = min(ans, x + y + z)
        z += 1

    print(ans)
n,m=map(int,input().split())
l=list(map(int,input().split()))
s=sum(l)
if s>l:
  print(-1)
else:
  print(l-s)

### FIXED CODE ###

n,m=map(int,input().split())
l=list(map(int,input().split()))
s=sum(l)
if s>n:
  print(-1)
else:
  print(n-s)
n = int(input())
A = Counter(list(map(int,input().split())))
keys,counts = zip(*A.most_common())
total = 0
for key,count in zip(keys,counts):
    if key > count:
        total += count
    else:
        total += count-key
print(total)

### FIXED CODE ###

from collections import Counter
n = int(input())
A = Counter(list(map(int,input().split())))
keys,counts = zip(*A.most_common())
total = 0
for key,count in zip(keys,counts):
    if key > count:
        total += count
    else:
        total += count-key
print(total)
N = int(input())
A = list(map(int, input().split()))

c = 0
e = len(A)
for i in range(e - ):
  d = 1
  if A[i] == d:
    d = d + 1
  else:
    c = c + 1

if c == e:
    print(-1)
else:
    print(c)

### FIXED CODE ###

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

c = 0
e = len(A)
d = 1
for i in range(e):
  if A[i] == d:
    d = d + 1
  else:
    c = c + 1

if c == e:
    print(-1)
else:
    print(c)