Harryxun/stf_run huggingface dataset:
N, M = map(int,input().split())
A = list(map(int,input().split()))
B = 0

for i in range(list(A)):
  if A[i] >= 1/(4*M):
    B += 1

if B >= M:
  print('Yes')
else B < M:
  print('No')
    

### FIXED CODE ###

N, M = map(int,input().split())
A = list(map(int,input().split()))
B = 0
C = 0

for i in range(len(A)):
  C += A[i]
  
for i in range(len(A)):
  if A[i] >= C/(4*M):
    B += 1

if B >= M:
  print('Yes')
else:
  print('No')
st = input()

if st[-1] == 's':
  return st + 'es'
else:
  return st + 's'

### FIXED CODE ###

st = input()
 
if st[-1] == 's':
    print(st + 'es')
else:
    print(st + 's')
import sys

S = sys.argv
if S <= '20190430':
  print('Heisei')
else:
  print('TBD')

### FIXED CODE ###

import sys

for S in sys.stdin:
  y,m,d = [int(x) for x in S.split('/')]
  if y<=2019 and m<=4:
    print('Heisei')
  else:
    print('TBD')
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 28 16:53:54 2019

@author: またの
"""

N,M=map(int,input().split())
L = []
for i in range(N):
    L.append(list(map(int,input().split())))

K1=[]
K2=[]
K3=[]
K4=[]
K5=[]
K6=[]
K7=[]
K8=[]

C = [0,0,0,0,0,0,0,0]

for i in range(N):
    K1.append(L[i][0]+L[i][1]+L[i][2])
K1.sort()

for i in range(N):
    K2.append(L[i][0]-L[i][1]+L[i][2])
K2.sort()

for i in range(N):
    K3.append(L[i][0]+L[i][1]-L[i][2])
K3.sort()

for i in range(N):
    K4.append(-L[i][0]+L[i][1]+L[i][2])
K4.sort()

for i in range(N):
    K5.append(-L[i][0]+L[i][1]-L[i][2])
K5.sort()

for i in range(N):
    K6.append(L[i][0]-L[i][1]-L[i][2])
K6.sort()

for i in range(N):
    K7.append(-L[i][0]-L[i][1]+L[i][2])
K7.sort()

for i in range(N):
    K8.append(-L[i][0]-L[i][1]-L[i][2])
K8.sort()

for i in range(M):
    C[0] += K1[M-i]
    C[1] += K2[M-i]
    C[2] += K3[M-i]
    C[3] += K4[M-i]
    C[4] += K5[M-i]
    C[5] += K6[M-i]
    C[6] += K7[M-i]
    C[7] += K8[M-i]
print(max(C))


### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Thu Feb 28 16:53:54 2019

@author: またの
"""

N,M=map(int,input().split())
L = []
for i in range(N):
    L.append(list(map(int,input().split())))

K1=[]
K2=[]
K3=[]
K4=[]
K5=[]
K6=[]
K7=[]
K8=[]

C = [0,0,0,0,0,0,0,0]

for i in range(N):
    K1.append(L[i][0]+L[i][1]+L[i][2])
K1.sort()

for i in range(N):
    K2.append(L[i][0]-L[i][1]+L[i][2])
K2.sort()

for i in range(N):
    K3.append(L[i][0]+L[i][1]-L[i][2])
K3.sort()

for i in range(N):
    K4.append(-L[i][0]+L[i][1]+L[i][2])
K4.sort()

for i in range(N):
    K5.append(-L[i][0]+L[i][1]-L[i][2])
K5.sort()

for i in range(N):
    K6.append(L[i][0]-L[i][1]-L[i][2])
K6.sort()

for i in range(N):
    K7.append(-L[i][0]-L[i][1]+L[i][2])
K7.sort()

for i in range(N):
    K8.append(-L[i][0]-L[i][1]-L[i][2])
K8.sort()

for i in range(M):
    C[0] += K1[N-i-1]
    C[1] += K2[N-i-1]
    C[2] += K3[N-i-1]
    C[3] += K4[N-i-1]
    C[4] += K5[N-i-1]
    C[5] += K6[N-i-1]
    C[6] += K7[N-i-1]
    C[7] += K8[N-i-1]
    
for i in range(8):
    C[i] = abs(C[i])
print(max(C))
n = int(input())
a = map(int,input().split())
a = sorted(a)

result = 0
spots = [a.pop()]

for i in range(n):
	next = a.pop()
	result += spots[i]
	spots.append(next)
	spots.append(next)
	
print(result)

### FIXED CODE ###

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

result = 0
spots = [a.pop()]

for i in range(n-1):
	x = a.pop()
	result += spots[i]
	spots.append(x)
	spots.append(x)
	
print(result)
H,W = map(int,input().split())
lists = [input() for i in range(W)]
x = 1
y = 1
for i in range(H):
    lists[i] = list(lists[i])
lists1 = []
lists2 = []
for i in range(W+1):
    lists1.append(".")
for i in range(W+1):
    lists2.append(".")
for i in range(H):
    lists[i].append(".")
lists2 = lists
check = True
while(x<W-1 and y<H-1):
    if(lists2[x][y] == "#"):
        if(x!=0 or y!=0 or x==W-1or y==H-1):
            if((lists2[x+1][y] == ".") and (lists2[x-1][y] == ".") and (lists2[x][y-1] == ".") and (lists2[x][y+1] == ".")):
                check = False
    x = x+1
    y = y+1
if(check):
    print("Yes")
else :
    print("No")

### FIXED CODE ###

H,W = map(int,input().split())
lists = [input() for i in range(H)]
x = 1
y = 1
check = True
for x in range(1,H-1):
    for y in range(1,W-1):
        if(lists[x][y] == "#"):
            if(x!=0 or y!=0 or x==W-1or y==H-1):
                if((lists[x+1][y] == ".") and (lists[x-1][y] == ".") and (lists[x][y-1] == ".") and (lists[x][y+1] == ".")):
                    check = False
if(lists[0][0] == "#"):
     if(lists[0][1] == "." and lists[1][0] == "."):
        check = False
if(lists[H-1][0] == "#"):
     if(lists[H-2][0] == "." and lists[H-1][1] == "."):
            check = False
if(lists[0][W-1] == "#"):
    if(lists[0][W-2] == "." and lists[1][W-1] == "."):
        check = False
if(lists[H-1][W-1] == "#"):
    if(lists[H-2][W-1] == "." and lists[H-1][W-2] == "."):
        check = False
if(check):
    print("Yes")
else :
    print("No")
num = input()

tmp = 0
for i in range(len(num)):
  if num[i]==num[i+1]: tmp+=1
  else: tmp=0
if tmp>=3: print('Yes')
else: print('No')

### FIXED CODE ###

num = input()
if num[:3].count(num[0])==3 or num[1:].count(num[1])==3:
  print("Yes")
else: print("No")
N, R = map(int, input().split())
if N >= 10:
  print(R)
else:
  print(R-100*(10-K))

### FIXED CODE ###

N,R = map(int, input().split())
if N >= 10:
  print(R)
else:
  print(R+100*(10-N))
H, N = map(int, input().split())
number = int(input().count(N))
S = sum(number)
if S / N >= H / N:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

H,N = map(int,input().split())
A = list(map(int,input().split()))
if sum(A) >= H:
  print("Yes")
else:
  print("No")
a = [list(map(int,input().split())) for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]

for i in range(3):
    for j in range(3):
      for k in b:
        if k == a[i][j]:
          a[i][j] = 101
          break
      
if a[1] == [101,101,101] or a[2] == [101,101,101] or a[3] == [101,101,101]:
  print('Yes')
  exit()
elif (a[1][1]==101 and a[2][1] ==101 and a[3][1] == 101) or (a[1][2]==101 and a[2][2] ==101 and a[3][2] == 101) and (a[1][3]==101 and a[2][3] ==101 and a[3][3] == 101):
  print('Yes')
  exit()
elif (a[1][1]==101 and a[2][2] ==101 and a[3][3] == 101) or (a[1][3]==101 and a[2][2] ==101 and a[3][1] == 101):
  print('Yes')
  exit()
else:
  print('No')

### FIXED CODE ###

a = [list(map(int,input().split())) for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]
 
for i in b:
  for j in range(3):
    for k in range(3):
      if i == a[j][k]:
        a[j][k] = 0
        
for i in range(3):
  if sum(a[i]) == 0:
    print('Yes')
    exit()
    
if a[0][0]+a[1][0]+a[2][0] == 0 or a[0][1]+a[1][1]+a[2][1] == 0 or a[0][2]+a[1][2]+a[2][2] == 0:
  print('Yes')
elif a[0][0]+a[1][1]+a[2][2] == 0 or a[0][2]+a[1][1]+a[2][0] == 0:
  print('Yes')
else:
  print('No')
import sys
data = []
for line in sys.stdin:
	data.append(line.split())

S = []
T = []
ans = []
S = data[1]
T = data[3]

for t in T:
    l = 0
    r = len(S)

    while l < r :
        i = (l + r) / 2
        if int(S[i]) < int(t) :
            l = i + 1
        elif int(S[i]) > int(t):
            r = i
        else :
            print(int(t))
            break


### FIXED CODE ###

import sys

if __name__ == '__main__':
    data = []
    count = 0
    for line in sys.stdin:
        data.append(line.split())
    s = list(map(int, data[1]))
    n = int(data[0][0])
    q = int(data[2][0])
    t = list(map(int, data[3]))
    for i in range(0, q):
        head = 0
        tail = n - 1
        while True:
            if head > tail :
                break
            center = (head + tail)//2
            if s[center] == t[i] :
                count = count + 1
                break
            elif s[center] < t[i]:
                head = center + 1
            else :
                tail = center - 1
    print(count)
n = int(input())
S = [input() for _ in range(n)]
cnt = 0
fb_cnt = 0
ba_cnt = 0
for s in S:
    idx = len(s) - 1
    for i in range(idx - 1):
        if s[i] == 'A' and s[i + 1] == 'B':
            cnt += 1
    if s[idx] == 'A':
        ba_cnt += 1
    if s[0] == 'B':
        fb_cnt += 1

min_cnt = min(fb_cnt, ba_cnt)
min_cnt = min_cnt - 1 if n <= min_cnt else min_cnt
print(cnt + min_cnt)


### FIXED CODE ###

n,k = map(int,input().split())
print(n-(k-1))
a = int(input())
s = str(input())
if a>= 3200: print(s)
else print("red")

### FIXED CODE ###

a = int(input()) 
s = str(input()) 
if a>= 3200: 
  print(s)
else:
  print("red")
from collections import defaultdict
X, N = map(int, input().split())
num = list(map(int, input().split()))

if N == 0:
    print(X)
else:
    num_list = [i for i in range(1, 101)]

    for i in range(X-1,-1,-1):
        if i in num:
            continue
        else:
            index1 = i
            break
            
    for i in range(X, 100):
        if i in num:
            continue
        else:
            index2 = i
            break
            
    if abs(X - index1) > abs(X - index2):
        print(index2)
    else:
        print(index1)

### FIXED CODE ###

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

if N == 0:
    print(X)
    exit()
else:
    for i in range(200):

        if X-i not in nums:
            print(X-i)
            exit()

        if X+i not in nums:
            print(X+i)
            exit()
import numpy as np

N = int(input())
E = np.zeros([N-1,2])
for n in range(N-1):
    temp = input().split()
    E[n,0]=int(temp[0])-1
    E[n,1] = int(temp[1])-1
starts = []; ends = []
for n in range(N-1):
    starts.append(E[n,0])
    ends.append(E[n,1])
edges = np.zeros([N-1])
for i in range(N-1):
    edges[i] = starts.count(i)+ends.count(i)
K = int(max(edges))
iro = np.zeros([N-1])
iro_set = [[] for i in range(N)]
for i in range(N-1):
    start = int(E[i,0]); end = int(E[i,1])
    kouho = list(range(1,K+1))
    for sude in iro_set[start]:
        kouho.remove(sude)
    for sude in iro_set[end]:
        kouho.remove(sude)
    iro[i] = kouho[0]
    iro_set[start].append(kouho[0])
    iro_set[end].append(kouho[0])
print(K)
for i in range(N-1):
    print(int(iro[i]))


### FIXED CODE ###

import sys
sys.setrecursionlimit(500000)
N = int(input())
E = [[] for _ in range(N+1)]
for i in range(N-1):
    a, b = map(int, input().split())
    E[a].append((b, i))
    E[b].append((a, i))
K = max(len(e) for e in E)
print(K)
Ans = [-1] * (N-1)
def dfs(v=1, p=0, p_col=-1):
    col = 1
    for u, idx in E[v]:
        if u!=p:
            if col == p_col:
                col += 1
            Ans[idx] = col
            dfs(u, v, col)
            col += 1
dfs()
print("\n".join(map(str, Ans)))
def area(ls):
    return ls[0] * ls[1]

def per(ls):
    return (2 * ls[0]) + (2 * ls[1])


if __name__ == '__main__':
    data = list(map(int, input().split()))
    s = area(data)
    l = per(data)
    print(s, l)

### FIXED CODE ###

def area(ls):
    return ls[0] * ls[1]

def per(ls):
    return (2 * ls[0]) + (2 * ls[1])


if __name__ == '__main__':
    data = list(map(int, input().split()))
    s = area(data)
    l = per(data)
    print(s, l)
N=input()
A=input()
B=input()
print((2-N)(A-B))

### FIXED CODE ###

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

min_sum = a * (n - 1) + b
max_sum = b * (n - 1) + a

print(max(max_sum - min_sum + 1, 0))
import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__


a,b,m = map(int, input().split())
aa = list(map(int, input().split()))
bb = list(map(int, input().split()))
ans = min(aa) + min(bb)

for i in range(m):
    x,y,c = map(int, input().split())
    x,y = x-1, y-1
    tmp = aa[x] + aa[y] - c
    ans = min(ans, tmp)
print(ans)

### FIXED CODE ###

import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__


a,b,m = map(int, input().split())
aa = list(map(int, input().split()))
bb = list(map(int, input().split()))
ans = min(aa) + min(bb)

for i in range(m):
    x,y,c = map(int, input().split())
    x,y = x-1, y-1
    tmp = aa[x] + bb[y] - c
    ans = min(ans, tmp)
print(ans)
import math
from functools import reduce
a,b=input().split()
l=sorted([int(x)-int(b) for x in input().split()])
print(abs(reduce(math.gcd, l)))

### FIXED CODE ###


import math
from functools import reduce
a,b=input().split()
l=sorted([abs(int(x)-int(b)) for x in input().split()])

def gcd(a,b):
    if a < b:
        a,b = b,a
    if  b==0:
        return a
    c = a % b
    return gcd(b,c)
while len(l)!=1:
    l.append(gcd(l.pop(0),l.pop(-1)))
print(sum(l))
import itertools
from collections import Counter
N=int(input())
balls=[]

for i in range(N):
    x,y=[int(j) for j in input().split(" ")]
    balls.append((x,y))

pqs=[]
for i in itertools.permutations(balls,2):
    p=i[1][0]-i[0][0]
    q=i[1][1]-i[0][1]
    pqs.append((p,q))

c=Counter(pqs)
c=dict(c)
c=sorted(c.items(),key=lambda w:w[1],reverse=True)
print(N-c[0][1])


### FIXED CODE ###

import itertools
from collections import Counter
import sys
N=int(input())
balls=[]

for i in range(N):
    x,y=[int(j) for j in input().split(" ")]
    balls.append((x,y))

pqs=[]
if N==1:
    print(1)
    sys.exit()
for i in itertools.permutations(balls,2):
    p=i[1][0]-i[0][0]
    q=i[1][1]-i[0][1]
    pqs.append((p,q))

c=Counter(pqs)
c=dict(c)
c=sorted(c.items(),key=lambda w:w[1],reverse=True)
print(N-c[0][1])
time = int(input())
jorney = [list(map(int,input().split())) for i in range(time)]
flg = True
x_before = 0
y_bfefore =0
t_before = 0

for point in jorney:
    time = point[0]
    x = point[1]
    y = point[2]
    distance = x- x_before + y - y_bfefore
    interval = t - t_before
    
    
    if t %2 == (x+y)%2 and interval >= distance:
        t_before=t
        x_before=x
        y_bfefore=y

        continue
    else:
        flg=False
        break
if flg:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

time = int(input())
jorney = [list(map(int,input().split())) for i in range(time)]
flg = True
x_before = 0
y_bfefore =0
t_before = 0

for point in jorney:
    t = point[0]
    x = point[1]
    y = point[2]
    distance = abs(x- x_before) + abs(y - y_bfefore)
    interval = t - t_before
    
    
    if t %2 == (x+y)%2 and interval >= distance:
        t_before=t
        x_before=x
        y_bfefore=y

        continue
    else:
        flg=False
        break
if flg:
    print("Yes")
else:
    print("No")
import sys
input = sys.stdin.readline
N = int(input())
node = [0 for i in range(N)]
neigh = [[] for j in range(N)]
ans = [0 for i in range(N)]
visited = [0 for i in range(N)]
k = 1

for i in range(N-1):
    ai,bi = map(int,input().split())
    node[ai-1] += 1
    node[bi-1] += 1
    neigh[ai-1].append(bi-1)
    neigh[bi-1].append(ai-1)
c = list(map(int,input().split()))
c.sort(reverse=True)
def dfs(neighbor,start,visited):
    global k
    global c
    if sum(visited) == N:
        return 0
    for i in neighbor[start]:
        if visited[i] == 0:
            ans[i] = c[k]
            k += 1
            visited[i] = 1
            dfs(neighbor,i,visited)
        else:
            continue
    return 0
m = max(node)
nn = node.index(m)
#nn = [node[i] for i in range(N) if node[i] == m][0]
visited[nn] = 1
ans[nn] = max(c)

dfs(neigh,nn,visited)
#ans2 = ' '.join([str(ans[i]) for i in range(N)])
ans2 = str(ans[0])
for i in range(1,N):
    ans2 = ans2+' '+str(ans[i])
print(sum(c)-max(c))
print(ans2)


### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
N = int(input())


node = [0 for i in range(N)]
neigh = [[] for j in range(N)]
ans = [0 for i in range(N)]
visited = [0 for i in range(N)]
k = 1

for i in range(N-1):
    ai,bi = map(int,input().split())
    node[ai-1] += 1
    node[bi-1] += 1
    neigh[ai-1].append(bi-1)
    neigh[bi-1].append(ai-1)
c = list(map(int,input().split()))
c.sort(reverse=True)
flag = False
def dfs(neighbor,start):
    global flag
    global k
    if sum(visited) == N:
        return 0

    for i in neighbor[start]:
        
        if visited[i] == 0:
            ans[i] = c[k]
            k += 1
            visited[i] = 1
            try:
                dfs(neighbor,i)
            except RuntimeError:
                flag = True
                return 0




m = max(node)
nn = node.index(m)
#nn = [node[i] for i in range(N) if node[i] == m][0]
visited[nn] = 1
ans[nn] = max(c)

dfs(neigh,nn)
"""
if flag:
    print(100)
    print(' '.join([str(i) for i in range(N)]))
    exit()
"""
ans2 = ' '.join([str(ans[i]) for i in range(N)])


print(sum(c)-max(c))
print(ans2)
# https://atcoder.jp/contests/m-solutions2019/submissions/5738704


from collections import deque, heapq

n = int(input())

g = [{"num":0,"neighber":[]} for _ in range(n+1) ]

for _ in range(n-1):

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

    g[a]["neighber"].append(b)
    g[b]["neighber"].append(a)


c = sorted( map(int, input().split()) )

# sum(c[:-1]) 
print( sum(c) - c[-1] )


i = 0
s = [(0,1)]

while i < len(s):
    
    pre, cur = s[i]
    i += 1

    g[cur]["num"] = c.pop()

    for e in g[cur]["neighber"]:
        if e == pre:
            continue

        s.append((cur,e))

print(" ".join(str(g[i]["num"])) for i in range(1,n+1))




### FIXED CODE ###



# https://atcoder.jp/contests/m-solutions2019/submissions/5738704


from collections import deque, _heapq

n = int(input())

g = [{"num":0,"neighber":[]} for _ in range(n+1) ]

for _ in range(n-1):

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

    g[a]["neighber"].append(b)
    g[b]["neighber"].append(a)


c = sorted( map(int, input().split()) )

# sum(c[:-1]) 
print( sum(c) - c[-1] )


i = 0
s = [(0,1)]

while i < len(s):
    
    pre, cur = s[i]
    i += 1

    g[cur]["num"] = c.pop()

    for e in g[cur]["neighber"]:
        if e == pre:
            continue

        s.append( (cur,e) )

ans = ''
for i in range(1,n+1):
    ans += str( g[i]["num"] ) + " "



print( ans[:-1] )
from itertools import groupby
s = input()
k = int(input())
l = [[k, len(list(g))] for k, g in groupby(s)]
ans = 0
ans2 = 0
for i in range(len(l)):
  if l[i][1] > 1:
    ans += l[i][1] // 2
if len(l) > 1:
  if l[0][0] == l[-1][0]:
    if l[0][1] % 2 == 1 and  l[-1][1] % 2 == 1 :
        ans2 = k - 1
if len(s) == 1:
  print(k // 2)
elif len(l) == 1:
  if l[0][1] % 2 == 1:
    print(((l[0][1] // 2) * k + (k - 1))
  else:
    print((l[0][1] // 2) * k)
else:
  print(ans * k + ans2)
    



### FIXED CODE ###

from itertools import groupby
s = input()
k = int(input())
l = [[k, len(list(g))] for k, g in groupby(s)]
ans = 0
ans2 = 0
for i in range(len(l)):
  if l[i][1] > 1:
    ans += l[i][1] // 2
if len(l) > 1:
  if l[0][0] == l[-1][0]:
    if l[0][1] % 2 == 1 and  l[-1][1] % 2 == 1 :
        ans2 = k - 1
if len(s) == 1:
  print(k // 2)
elif len(l) == 1:
  #if l[0][1] % 2 == 1:
  #  print(((l[0][1] // 2) * k + (k - 1)))
  #else:
  print(len(s) * k // 2)
else:
  print(ans * k + ans2)
# -*- coding: utf-8 -*-
def check(z, zz, z_list, dire):
  zz += z_list[0] * dire
  if len(z_list) == 1:
    if z == zz:
      return 1
    else:
      return 0
  else:
    if check(z, zz, z_list[1:], 1) == 0:
      return 0
    if check(z, zz, z_list[1:], -1) == 0:
      return 0
    return 1

    
def func(x, y, xx, yy, x_list, y_list):
  if len(x_list) == 0:
    if x != xx:
      return 0
  else:
    if check(x, xx, x_list, 1) == 0:
      return 0
    if check(x, xx, x_list, -1) == 0:
      return 0
  if len(y_list) == 0:
    if y != yy:
      return 0
  else:
    if check(y, yy, y_list, 1) == 0:
      return 0
    if check(y, yy, y_list, -1) == 0:
      return 0
  return 1

s = input()
x, y = map(int, input().split())
data = s.split("T")
xx, yy = 0, 0
i = 0
x_list = []
y_list = []
for Fs in data:
  if len(Fs) == 0:
    i += 1
  else:
    if i == 0:
      xx = len(Fs)
    elif i % 2 == 0:
      x_list.append(len(Fs))
    else:
      y_list.append(len(Fs))
    i += 1
if func(x, y, xx, yy, x_list, y_list) == 1:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

# -*- coding: utf-8 -*-
def check(z, zz, z_list):
  if len(z_list) == 0:
    if z != zz:
      return 0
    else:
      return 1
  else:
    z_n = len(z_list)
    z_hash = {}
    z_hash[0] = {}
    z_hash[0][zz] = 1
    z_hash[z_n] = {}
    z_hash[z_n][z] = 1
    for i in range(0,z_n):
      if i+1 not in z_hash:
        z_hash[i+1] = {}
        for b_z in z_hash[i]:
          a_z = b_z + z_list[i]
          z_hash[i+1][a_z] = 1
          a_z = b_z - z_list[i]
          z_hash[i+1][a_z] = 1
      else:
        for b_z in z_hash[i]:
          a_z = b_z + z_list[i]
          if a_z in z_hash[i+1]:
            return 1
          a_z = b_z - z_list[i]
          if a_z in z_hash[i+1]:
            return 1
        return 0
      if z_n-i-1 not in z_hash:
        z_hash[z_n-i-1] = {}
        for a_z in z_hash[z_n-i]:
          b_z = a_z + z_list[z_n-i-1]
          z_hash[z_n-i-1][b_z] = 1
          b_z = a_z - z_list[z_n-i-1]
          z_hash[z_n-i-1][b_z] = 1
      else:
        for a_z in z_hash[z_n-i]:
          b_z = a_z + z_list[z_n-i-1]
          if b_z in z_hash[z_n-i-1]:
            return 1
          b_z = a_z - z_list[z_n-i-1]
          if b_z in z_hash[z_n-i-1]:
            return 1
        return 0



s = input()
x, y = map(int, input().split())
data = s.split("T")
xx, yy = 0, 0
i = 0
x_list = []
y_list = []
for Fs in data:
  if len(Fs) == 0:
    i += 1
  else:
    if i == 0:
      xx = len(Fs)
    elif i % 2 == 0:
      x_list.append(len(Fs))
    else:
      y_list.append(len(Fs))
    i += 1
if check(x, xx, x_list) == 1 and check(y, yy, y_list) == 1:
  print("Yes")
else:
  print("No")
A, B = input().split(" ")
if A <= 8 and B <= 8:
    print("Yay!")
else:
    print(":(")

### FIXED CODE ###

A, B = list(int(a) for a in input().split(" "))
if A <= 8 and B <= 8:
    print("Yay!")
else:
    print(":(")
a,b,c = map(int,input().split())
if c-a-b<=0:
  print("No")
else:
  if (c-a-b)**2>4ab:
    print("Yes")
  else("No")

### FIXED CODE ###

a,b,c = map(int,input().split())
if c-a-b<=2:
  print("No")
else:
  if (c-a-b)**2-4*a*b>0:
    print("Yes")
  else:
    print("No")
import math
n,k = map(int,input().split())
print(min(n%k,k-n%k))

### FIXED CODE ###

#ab,ac
a,b,c = map(int,input().split())
a,b = b,a
a,c = c,a
print(a,b,c)
import sys
#import numpy as np

def main(N, S):
    #dp = np.zeros((N + 1, N + 1), dtype=int)
    dp = [[0] * (N + 1) for _ in range(N + 1)]
    for i in range(N - 1):
        for j in range(i + 1, N):
            dp[i][j] = min(j - i, dp[i - 1][j - 1] + 1) if S[i] == S[j] else 0
        ans = max(ans, max(dp[i]))
    return ans

if sys.argv[-1] == 'ONLINE_JUDGE' & 0:
    import numba
    from numba.pycc import CC
    i8 = numba.int64
    cc = CC('my_module')

    def cc_export(f, signature):
        cc.export(f.__name__, signature)(f)
        return numba.njit(f)

    main = cc_export(main, (i8, i8[:]))
    cc.compile()

#from my_module import main

N = int(read())
S = [ord(_) for _ in input()]
print(main(N, S))


### FIXED CODE ###

import itertools
N = int(input())
S = input()
dp = [[0] * N for _ in range(N)]
ans = 0
for i, j in itertools.combinations(range(N), 2):
    if S[i] == S[j]:
        dp[i][j] = dp[i - 1][j - 1] + 1
    else:
        dp[i][j] = 0
    ans = max(ans, min(j - i, dp[i][j]))
print(ans)
from operator import mul
from functools import reduce

def cmb(n, r):
	if n < r: return 0
	if r == 0 or n - r == 0: return 1
	r = min(n - r, r)
	u = reduce(mul, range(n, n - r, -1))
	d = reduce(mul, range(1, r + 1))
	return u // d % mod

N, A, B, K = map(int, input().split())
mod = 998244353
ans = 0
for r in range(N + 1):
	if (K - A * r) % B == 0:
		ans += cmb(N, r) * cmb(N, (K - A * r) // B)
		ans %= mod
print(ans)

### FIXED CODE ###

N, A, B, K = map(int, input().split())
mod = 998244353
m = N

fac = [1] * (m + 1)
inv = [1] * (m + 1)
for i in range(1, m + 1):
	fac[i] = fac[i - 1] * i % mod
inv[-1] = pow(fac[-1], mod - 2, mod)
for i in range(m - 1, -1, -1):
	inv[i] = inv[i + 1] * (i + 1) % mod

def cmb(n, r):
	assert n >= r >= 0
	return fac[n] * inv[n - r] * inv[r] % mod

ans = 0
for r in range(N + 1):
	if (K - A * r) % B == 0:
		b = (K - A * r) // B
		if 0 <= b <= N:
			ans += cmb(N, r) * cmb(N, (K - A * r) // B)
			ans %= mod
print(ans)
num = [int(n) for n in input().split(" ")]

a = num[1]
b = num[2]
c = num[3]

count = 0
for i in range(a, b+1):
    if c % i == 0:
        count += 1
        

### FIXED CODE ###

num = [int(n) for n in input().split(" ")]

a = num[0]
b = num[1]
c = num[2]

count = 0
for i in range(a, b+1):
    if c % i == 0:
        count += 1
print(count)