Harryxun/stf_run huggingface dataset:
#abc176-e
import sys
input = sys.stdin.readline
H,W,M=list(map(int,input().split()))

point_bom = [[0]*(W+1) for _ in range(H+1)]
for _ in range(M):
    h,w = map(int,input().split())
    point_bom[h][w]=1
#point_bom = np.array(point_bom)
#row_bom = point_bom.sum(axis=0)
#col_bom = point_bom.sum(axis=1)
row_bom = []
for rb in point_bom:
    row_bom.append(sum(rb))
col_bom = [sum(x) for x in zip(*point_bom)]
    
max_row = max(row_bom)
max_col = max(col_bom)

ind_max_row =[]
ind_max_col = []

for i in range(len(row_bom)):
    if row_bom[i] == max_row:
         ind_max_row.append(i)
for i in range(len(col_bom)):
    if col_bom[i] == max_col:
        ind_max_col.append(i)

flag = 1#爆破対象が置かれる　おかれている＝１　いない＝０
for mr in ind_max_row:
    for mc in ind_max_col:
        if point_bom[mr][mc] == 0:
            flag = 0
            break
    if flag == 0:
        break
print(max_row+max_col - flag)
        
        


### FIXED CODE ###

import sys,math,collections,itertools
input = sys.stdin.readline

H,W,M=map(int,input().split())
bom = [] #ボムの場所
bomH =[0]*(H+1) 
bomW=[0]*(W+1)

for _ in range(M):
    h,w=map(int,input().split())
    bom.append((h,w))
    bomH[h]+=1
    bomW[w]+=1

#縦の爆弾と横の爆弾は独立。爆弾を置く場所に爆弾があると-1
max_bomH = max(bomH)
max_bomW = max(bomW)

cnt = 0#爆弾が置かれた場所のbomH,bomWがともにMaxの場所の数
for h,w in bom:
    if bomH[h]==max_bomH and bomW[w] == max_bomW:
        cnt += 1

print(max_bomH +max_bomW -(cnt == bomH.count(max_bomH) * bomW.count(max_bomW)))
def op_print(data,a,b):
    print(data[a:b])
def op_reverse(data,a,b):
    return data[:a] + data[::-1][-b:-a] + data[:b]
def op_replace(data,a,b,q):
    return data.replace(data[a:b],q) 

data = input()
q = int(input())
for _ in range(q):
    op = list(map(str,input().split()));num[2]+=1
    if(op[0] == "print"):
        op_print(data,int(op[1]),int(op[2]))
    elif(op[0] == "reverse"):
        data = op_reverse(data,int(op[1]),int(op[2]))
    elif(op[0] == "replace"):
        data = op_replace(data,int(op[1]),int(op[2]),op[3])


### FIXED CODE ###

s=input()
for _ in range(int(input())):
    o=input().split()
    a,b=map(int,o[1:3]);b+=1
    c=o[0][2]
    if c=='p':s=s[:a]+o[3]+s[b:]
    elif c=='i':print(s[a:b])
    elif c=='v':s=s[:a]+s[a:b][::-1]+s[b:]
N,M = map(int,input().split())
L = []
R = []
for i in range(M+1):
  L_val,R_val = map(int,input().split())
  L.append(L_val)
  R.append(R_val)
ans = max(min(R) - max(L) + 1,0)
print(ans)

### FIXED CODE ###

N,M = map(int,input().split())
L = []
R = []
for i in range(1,M+1):
  L_val,R_val = map(int,input().split())
  L.append(L_val)
  R.append(R_val)
ans = max(min(R) - max(L) + 1,0)
print(ans)
a,b=list(map(int, input().split()))
if a<=8 and b<=8:
    print(‘Yay!’)
else:
    print(‘:(’)


### FIXED CODE ###

a,b=list(map(int, input().split()))
if a<=8 and b<=8:
    print('Yay!')
else:
    print(':(')
A,B,K=map(int,input().split())
if A>=K:
  print(str(A-k)+" "+str(B))
else:
  if A+B>=K:
    print("0 "+str(A+B-K))
  else:
    print("0 0")

### FIXED CODE ###

A,B,K=map(int,input().split())
if A>=K:
  print(str(A-K)+" "+str(B))
else:
  if A+B>=K:
    print("0 "+str(A+B-K))
  else:
    print("0 0")
X, A = map(int, input().split())

if X<A:
  return 0
else:
  return10

### FIXED CODE ###

X, A = map(int, input().split())
 
if X<A:
  print(0)
else:
  print(10)
def count():
    a, b, x = map(int, input().split())
    count = 0
    for i in range(a, b+1):
        if i % x == 0:
            count += 1

    print(count)


if __name__ == "__main__":
    count()



### FIXED CODE ###


def contest(x):

    x = x.split()
    print(x[0][0] + x[1][0] + x[2][0])

if __name__ == "__main__":
    
    x = input()
    contest(x)
n=input()
a=list(map(int,input().split()))
n=sum(x<0 for x in a)
a=[map(abs,a)]
s=sum(a) if n%2==0 else sum(a)-min(a)*2
print(s)


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
b=[abs(x) for x in a]
ret=0
for i in range(n):
  if a[i]!=b[i]:
    ret+=1
ans=sum(b)
if ret%2:
  ans-=2*min(b)
print(ans)
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]

    N,M = LI()
    A = [LI() for _ in range(N)]

    ctr = [0] * N

    sp = [0] * (M+1)
    for i in range(N):
        sp[A[i][ctr[i]]] += 1
    ans = max(sp)

    for _ in range(N-1):
        m = 0
        mi = -1
        for i in range(1,M+1):
            if sp[i] > m:
                m = sp[i]
                mi = i
        sp[mi] = -1
        for i in range(N):
            if A[i][ctr[i]] == mi:
                while sp[A[i][ctr[i]]] < 0:
                    ctr[i] += 1
                sp[A[i][ctr[i]]] += 1
        ans = min(ans,max(sp))

    print(ans)


if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]

    N,M = LI()
    A = [LI() for _ in range(N)]

    ctr = [0] * N

    sp = [0] * (M+1)
    for i in range(N):
        sp[A[i][ctr[i]]] += 1
    ans = max(sp)

    for _ in range(M-1):
        m = 0
        mi = -1
        for i in range(1,M+1):
            if sp[i] > m:
                m = sp[i]
                mi = i
        sp[mi] = -1
        for i in range(N):
            if A[i][ctr[i]] == mi:
                while sp[A[i][ctr[i]]] < 0:
                    ctr[i] += 1
                sp[A[i][ctr[i]]] += 1
        ans = min(ans,max(sp))

    print(ans)


if __name__ == '__main__':
    main()
s=input().find;i=s(' ');j=s(' ',i);print('YNEOS'[s[i-1]+s[j+1]!=s[i+1]+s[j-1]::2])

### FIXED CODE ###

a,b,c=input().split();print('YNEOS'[a[::-1][0]!=b[0]or b[::-1][0]!=c[0]::2])
a,b,c=map(int,input().split())
print(min(b//a, c)

### FIXED CODE ###

a,b,c=map(int,input().split())
print(min(b//a,c))
import string
import sys

w = input()
w.upper()

cnt = 0

while True:
    S = input().split()
    if len(S) == 0:
        break

    for s in S:
        s.upper()

        if w in s:
            cnt += 1

print(cnt)

### FIXED CODE ###

W = input().lower()

cnt = 0
while True:
    T = input().split()
    
    if T[0] == "END_OF_TEXT":
        break
        
    for string in T:
        string = string.rstrip(".").lower()
        #print(string)
        if W == string:
           cnt = cnt + 1
        
print(cnt)
A_list = []
for i in range(5):
    A_list.append(input())
one_list = []
one_list.append(int(A_list[0][-1]))
one_list.append(int(A_list[1][-1]))
one_list.append(int(A_list[2][-1]))
one_list.append(int(A_list[3][-1]))
one_list.append(int(A_list[4][-1]))
min_num = max(one_list)
for i in range(len(one_list)):
    if one_list[i] != 0 and min_num >= one_list[i]:
        min_num = one_list[i]
        min_one_list_index = i
A_list_min = A_list[min_one_list_index]
del A_list[min_one_list_index]


def ceil(src, range):
    return ((int)(src / range) + 1 ) * range


for i in range(len(A_list)):
    A_list[i] = ceil(int(A_list[i]), 10)
print(sum(A_list)+int(A_list_min))

### FIXED CODE ###

A_list = []
for i in range(5):
    A_list.append(input())
one_list = []
one_list.append(int(A_list[0][-1]))
one_list.append(int(A_list[1][-1]))
one_list.append(int(A_list[2][-1]))
one_list.append(int(A_list[3][-1]))
one_list.append(int(A_list[4][-1]))
min_num = max(one_list)
min_one_list_index = 1
for i in range(len(one_list)):
    if one_list[i] != 0 and min_num >= one_list[i]:
        min_num = one_list[i]
        min_one_list_index = i
A_list_min = A_list[min_one_list_index]
del A_list[min_one_list_index]


def ceil(src, range):
    if src % 10 == 0:
        return src
    else:
        return ((int)(src / range) + 1 ) * range


for i in range(len(A_list)):
    A_list[i] = ceil(int(A_list[i]), 10)
print(sum(A_list)+int(A_list_min))
n = int(input())
a_list = list(map(lambda x: int(x), input().split()))
possesion = 1000
num_stock = 0

for i in range(len(a_list) - 1):
    a_today = a_list[i]
    for a in a_list[i+1:]:
        if a != a_today:
            a_next = a
            break
    
    if a_today < a_next:
        # 買えるだけ買う
        possesion_yesterday = possesion
        possesion = possesion % a_today
        num_stock += possesion_yesterday // a_today
    if a_today > a_next:
        # うれるだけうる
        possesion += num_stock * a_today
        num_stock = 0

# 最終日は買えるだけ買う
possesion += num_stock * a_list[-1]
print(possesion)

### FIXED CODE ###

import sys

n = int(input())
a_list = list(map(lambda x: int(x), input().split()))
possesion = 1000
num_stock = 0

# print(a_list)
for i in range(len(a_list) - 1):
    a_today = a_list[i]
    for a in a_list[i+1:]:
        a_next = a
        if a != a_today:
            break
    # これからずっと値段が変わらない場合は全部売ってあと放置
    if a_next == a_today:
        possesion += num_stock * a_list[-1]
        print(possesion)
        sys.exit()
    
    if a_today < a_next:
        # 買えるだけ買う
        possesion_yesterday = possesion
        possesion = possesion % a_today
        num_stock += possesion_yesterday // a_today
    if a_today > a_next:
        # うれるだけうる
        possesion += num_stock * a_today
        num_stock = 0
#     print(a_today, a_next, possesion, num_stock)

# 最終日は買えるだけ買う
possesion += num_stock * a_list[-1]
print(possesion)
n = int(input())
n_list = list(map(int, input().split()))

multi = 1

for i in range(n):
    if n_list[i]==0:
        a = 0
        multi = 0
        break

for i in range(n):
    if a == 0:
        break

    multi *= n_list[i]

    if multi>1e18:
        break

print(multi)
if multi<=1e18:
    print(multi)
else:
    print(-1)

### FIXED CODE ###

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

multi = 1
a = 1

for i in range(n):
    if n_list[i]==0:
        a = 0
        break

for i in range(n):
    if a == 0:
        multi = 0
        break

    multi *= n_list[i]

    if multi>1e18:
        break

if multi<=1e18:
    print(multi)
else:
    print(-1)
# encoding: utf-8

import sys

def solve(a, b, h):
    return (a + b) * h / 2


a = sys.stdin.readline().rstrip()
int(a)
b = sys.stdin.readline().rstrip()
int(b)
h = sys.stdin.readline().rstrip()
int(h)
ans = solve(a, b, h)
print "{0}".format(ans)


### FIXED CODE ###

def solve(a, b, h):
    return (a + b) * h / 2


a = raw_input()
a = int(a)
b = raw_input()
b = int(b)
h = raw_input()
h = int(h)
ans = solve(a, b, h)
print ans
import math

def floatinput():
    a = input().split()
    for i in range(len(a)):
        a[i] = float(a[i])
    return a
   
def main():
    a = numinput()
    x1 = a[0]; y1 = a[1]; x2 = a[2]; y2 = a[3]
    print(math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
   
if __name__ == "__main__":
    main()



### FIXED CODE ###

# AOJ ITP1_10_A

import math

def floatinput():
    a = input().split()
    for i in range(len(a)):
        a[i] = float(a[i])
    return a

def main():
    data = floatinput()
    x1 = data[0]; y1 = data[1]; x2 = data[2]; y2 = data[3]
    print(math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2))

if __name__ == "__main__":
    main()
N = input()
L = list(map(int, input().split()))

ans = 0
t = []
if(N >= 3):
  for i in range(N):
    for j in range(N):
      for k in range(N):
        if((abs(j-k) < a) && (a < j+k)): t.append([i, j, k])

t = list(set(t))
print(len(t))

### FIXED CODE ###

N = int(input())
L = list(map(int, input().split()))
 
ans = 0
if(N >= 3):
  t = []
  for i in range(N):
    for j in range(i+1, N):
      for k in range(j+1, N):
        if((L[i] != L[j]) & (L[i] != L[k]) & (L[j] != L[k]) & (abs(L[j]-L[k]) < L[i]) & (L[i] < L[j]+L[k])): t.append((L[i], L[j], L[k]))
  ans = len(t)

print(ans)
#### import ####
import sys
import math
from collections import defaultdict

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

#### 定数 ####
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))

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

n,m,s,t = II()
u,v,a,b = Line(m)

c = []
for i in range(m):
  c.append([u[i]-1,v[i]-1,a[i]])
  c.append([v[i]-1,u[i]-1,a[i]])

from heapq import heappop, heappush
inf=float('inf')
d=[inf for _ in range(n)]
d[s-1]=0
prev=[None]*n
p=dict()
for i,j,k in c: p[i]=p.get(i,[])+[(j,k)]

q=[]
heappush(q,(d[s-1],s-1))
while q:
  du, u1 = heappop(q)
  if d[u1]<du: continue
  for v1,weight in p.get(u1,[]):
    alt=du+weight
    if d[v1]>alt:
      d[v1]=alt
      prev[v1]=u1
      heappush(q, (alt,v1))

c2 = []
for i in range(m):
  c2.append([u[i]-1,v[i]-1,b[i]])
  c2.append([v[i]-1,u[i]-1,b[i]])

d2=[inf for _ in range(n)]
d2[t-1]=0
prev=[None]*n
p=dict()
for i,j,k in c2: p[i]=p.get(i,[])+[(j,k)]

q=[]
heappush(q,(d2[t-1],t-1))
while q:
  du, u2 = heappop(q)
  if d2[u2]<du: continue
  for v2,weight in p.get(u2,[]):
    alt=du+weight
    if d2[v2]>alt:
      d2[v2]=alt
      prev[v2]=u2
      heappush(q, (alt,v2))

ans = d[n-1]+d2[n-1]
for i in range(1,n):
  ans.append(min(ans[i-1],d[n-1-i]+d2[n-1-i]))

for i in range(n):
  print(10**15-ans[n-1-i])

### FIXED CODE ###

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

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

#### 定数 ####
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))

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

n,m,s,t = II()
u,v,a,b = Line(m)

from heapq import heappop, heappush
def dijkstra(E,s,n):
  inf=float('inf')
  d=[inf for _ in range(n)]
  d[s]=0
  q=[]
  heappush(q,(0,s))
  while q:
    du, u1 = heappop(q)
    if d[u1]<du: continue
    for v1,weight in E[u1].items():
      alt=du+weight
      if d[v1]>alt:
        d[v1]=alt
        heappush(q, (alt,v1))
  return d

p = [dict() for _ in range(n)]
p2 = [dict() for _ in range(n)]
for i in range(m):
  p[u[i]-1][v[i]-1] = a[i]
  p[v[i]-1][u[i]-1] = a[i]
  p2[u[i]-1][v[i]-1] = b[i]
  p2[v[i]-1][u[i]-1] = b[i]

d = dijkstra(p,s-1,n)
d2 = dijkstra(p2,t-1,n)

ans = [0]*n
ans[0] = d[n-1]+d2[n-1]
for i in range(1,n):
  ans[i] = min(ans[i-1],d[n-1-i]+d2[n-1-i])

for i in ans[::-1]:
  print(10**15-i)
N, Q = map(int, input().split())

ab_list = []
tree_dict = {}
for i in range(N-1):
    a, b = map(int, input().split())
    ab_list.append(a)
    ab_list.append(b)

    if a not in tree_dict:
        tree_dict[a] = [b]
    else:
        tree_dict[a].append(b)

#value_dict = {k:0 for k in list(set(ab_list))}                                          
value_list = list(set(ab_list))

px_dict = {}
for i in range(Q):
    p, x = map(int, input().split())
    if p in px_dict:
        px_dict[p] += x
    else:
        px_dict[p] = x

out = ""
for v in value_list:
    x = px_dict[v]
    if v in tree_dict:
        tree_list = tree_dict[v]
        for t in tree_list:
            if t in px_dict:
                px_dict[t] += x
            else:
                px_dict[t] = x
    if v in px_dict:
        o = str(px_dict[v])
    else:
        o = str(0)
    out += o + " "

print(out)

### FIXED CODE ###

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

ab_list = []
tree_dict = {}
for i in range(N-1):
    a, b = map(int, input().split())
    ab_list.append(a)
    ab_list.append(b)

    if a not in tree_dict:
        tree_dict[a] = [b]
    else:
        tree_dict[a].append(b)

value_list = list(set(ab_list))

px_dict = {}
for i in range(Q):
    p, x = map(int, input().split())
    if p in px_dict:
        px_dict[p] += x
    else:
        px_dict[p] = x

out = ""
for v in value_list:
    if v in px_dict:
        x = px_dict[v]
        if v in tree_dict:
            tree_list = tree_dict[v]
            for t in tree_list:
                if t in px_dict:
                    px_dict[t] += x
                else:
                    px_dict[t] = x
        o = str(px_dict[v])
    else:
        o = str(0)
    out += o + " "

print(out[:-1])
#最大公約数を求める再帰関数-->計算量O(log(max(x))
def gcd(x, y):
    if x < y:
        x, y = y, x
    if y == 0:
        return x
    return gcd(x-y, y)


#本文
N = int(input())
list_A = list(map(int, input().split()))

#配列初期化
list_gcd = [0] * N
list_gcd_rev = [0] * N

#配列の最初のgcdを求める。定義
list_gcd[0] = list_A[0]
list_gcd_rev[N-1] = list_A[N-1]
#print (list_gcd, list_gcd_rev)

#配列にgcdを代入していく
for i in range(1,N):
    list_gcd[i] = gcd(list_gcd[i-1], list_A[i])
#print (list_gcd)
for j in range(1,N):
    list_gcd_rev[N-1-j] = gcd(list_gcd_rev[N-j], list_A[N-1-j])
#print (list_gcd_rev)

#print (list_gcd, list_gcd_rev)

#k番目までの両端からのgcdを求める
if N == 2:
    ans = gcd(list_gcd[N-2], list_gcd_rev[1])
else:
    ans = max(list_gcd[N-2], list_gcd_rev[1]) #両端の文字を除いたときの答え
#print (ans)
for k in range(1,N-1):
    a = list_gcd[k-1]
    b = list_gcd_rev[k+1]
    ans = max(ans, gcd(a, b))
print (ans)

### FIXED CODE ###

#最大公約数を求める再帰関数-->計算量O(log(max(x))
def gcd1(x, y):
    if x < y:
        x, y = y, x
    if y == 0:
        return x
    return gcd(x-y, y)

def gcd(x,y):
    if x<y:
        x,y=y,x
    #x>y
    if y==0:
        return x
    if x%y==0:
        return y
    else:
        return gcd(y,x%y)


#本文
N = int(input())
list_A = list(map(int, input().split()))

#配列初期化
list_gcd = [0] * N
list_gcd_rev = [0] * N

#以下　間違いを発見できず

##配列の最初のgcdを求める。定義
#list_gcd[0] = list_A[0]
#list_gcd_rev[N-1] = list_A[N-1]
##print (list_gcd, list_gcd_rev)

##配列にgcdを代入していく
#for i in range(1,N):
#    list_gcd[i] = gcd(list_gcd[i-1], list_A[i])
##print (list_gcd)
#for j in range(1,N):
#    list_gcd_rev[N-1-j] = gcd(list_gcd_rev[N-j], list_A[N-1-j])
##print (list_gcd_rev)

##print (list_gcd, list_gcd_rev)

##k番目までの両端からのgcdを求める
#if N == 2:
#    ans = gcd(list_gcd[0], list_gcd_rev[1])
#else:
#    ans = max(list_gcd[N-2], list_gcd_rev[1]) #両端の文字を除いたときの答え
##print (ans)
#for k in range(1,N-1):
#    a = list_gcd[k-1]
#    b = list_gcd_rev[k+1]
#    ans = max(ans, gcd(a, b))
#print (ans)

#以下、正答

for i in range(1,N):
    list_gcd[i]=gcd(list_gcd[i-1],list_A[i-1])
for i in range(N-1)[::-1]:
    list_gcd_rev[i]=gcd(list_gcd_rev[i+1],list_A[i+1])
Z = [gcd(list_gcd[i], list_gcd_rev[i]) for i in range(N)]
print (max(Z))
N = int(input())
task = []
for i in range(N):
  M = list(map(int,input().split()))
  swap(M[0],M[1])
  task.append(M)
task.sort()
K = 0
ans = 1
for i in range(N):
  K += task[i,1]
  if (K>task[i,0]):
    ans = 0
    break
if ans:
  print("Yes")
else:
  print("No")
  

### FIXED CODE ###

N = int(input())
task = []
for i in range(N):
  M = list(map(int,input().split()))
  M[0],M[1]=M[1],M[0]
  task.append(M)
task.sort()
K = 0
ans = 1
for i in range(N):
  K += task[i][1]
  if (K>task[i][0]):
    ans = 0
    break
if ans:
  print("Yes")
else:
  print("No")
n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[10000000000]*(n+1)
h.insert(0,0)
dp[0]=0
dp[1]=0
dp[2]=abs(h[2]-h[1])
for i in range(3,n+1):
    for j in range(i-1,max((i-k-1),0),-1):
        dp[i]=min(dp[i],abs(h[i]-h[j])+dp[j])
print(dp[n])



### FIXED CODE ###

n=int(input())
h=list(map(int,input().split()))
dp=[0]*(n+1)
h.insert(0,0)
dp[2]=abs(h[2]-h[1])
for i in range(3,n+1):
    dp[i]=min(abs(h[i]-h[i-1])+dp[i-1],abs(h[i]-h[i-2])+dp[i-2])
print(dp[n])
import numpy as np
num_list = []

def leg_num(c, t):
    return 2*c+4*t

for i in range(1, 101):
    leg_num_list = []
    for j in range(i):
        if leg_num(j, i-j) <= 100:
            leg_num_list.append(leg_num(j, i-j))
        if leg_num(i-j, j) <= 100:
            leg_num_list.append(leg_num(i-j, j))
    num_list.append(leg_num_list)

x, y = map(int, input().split(" "))
    if y in num_list[x]:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

import numpy as np
num_list = []

def leg_num(c, t):
    return 2*c+4*t

for i in range(1, 101):
    leg_num_list = []
    for j in range(i):
        if leg_num(j, i-j) <= 100:
            leg_num_list.append(leg_num(j, i-j))
        if leg_num(i-j, j) <= 100:
            leg_num_list.append(leg_num(i-j, j))
    num_list.append(leg_num_list)

x, y = map(int, input().split(" "))
if y in num_list[x-1]:
    print("Yes")
else:
    print("No")
from math import asin, atan, pi

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

if x == a * a * b:
  print(0)
if x >= a * a * b / 2:
  print(atan((a*a*b-x)/(a*a*a)*2)/(2 * pi)*360)
else:
  print(90 - asin(x/(a*b/2))/(2 * pi)*360)


### FIXED CODE ###

from math import atan, pi

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

if x == a * a * b:
  print(0)
elif x >= a * a * b / 2:
  print(atan((a*a*b-x)/(a*a*a)*2)/(2 * pi)*360)
else:
  print(90 - atan(x/(a*b*b/2))/(2 * pi)*360)
import math
n = int(input())
A = [int(i) for i in input().split()]
cnt, ans = 0, 0
for i in range(n):
  if A[i] == A[i+1]:
    cnt += 1
  else:
    ans += math.floor((cnt+1)/2)
    cnt = 0
print(ans)

### FIXED CODE ###

import math
n = int(input())
A = [int(i) for i in input().split()]
cnt, ans = 0, 0
for i in range(n-1):
  if A[i] == A[i+1]:
    cnt += 1
    if i == n-2:
      ans += math.floor((cnt+1)/2)
  else:
    ans += math.floor((cnt+1)/2)
    cnt = 0
print(ans)
import numpy as np
N,K=map(int,input().split())
P=list(map(int,input().split()))
Q=[]
def ex(A):
  return (1+A)/2.0
for i in range(N):
  Q.append(ex(P[i]))
Q=np.array(Q)
R=Q.cumsum()
ans=0
for i in range(K,N):
  S=R[i]-R[i-K]
  if ans<S:
    ans=S
print(ans)

### FIXED CODE ###

import numpy as np
N,K=map(int,input().split())
P=list(map(int,input().split()))
Q=[0]
def ex(A):
  return (1+A)/2.0
for i in range(N):
  Q.append(ex(P[i]))
Q=np.array(Q)
R=Q.cumsum()
ans=0
for i in range(K,N+1):
  S=R[i]-R[i-K]
  if ans<S:
    ans=S
print(ans)
import bisect
n = int(input())
x = sorted(list(map(int,input().split())), reverse=True)
y = sorted(list(map(int,input().split())), reverse=True)
z = sorted(list(map(int,input().split())), reverse=True)
count = 0
X =[]
for b in range(n):
  k = bisect.bisect_right(x,y[b])
  X[b] =(n-k)
for a in range(n):
  j = bisect.bisect_right(y,z[a])
  count+=sum(X[j:])
print(count)

### FIXED CODE ###

import bisect
n = int(input())
X = sorted(list(map(int,input().split())))
Y = sorted(list(map(int,input().split())))
Z = sorted(list(map(int,input().split())))
print(sum(bisect.bisect_left(X,b) * (n-bisect.bisect_right(Z,b)) for b in Y))
N,A,B = map(int,input().split())
qaws = ""
c = 0
while(N > len(qaws)):
  qaws = qaws + "B"*A
  qaws = qaws + "R"*B
  c += 1
print(qaws[:N].count("B"))

### FIXED CODE ###

n,a,b=map(int,input().split())
ans = n//(a+b)*a
r = n%(a+b)
print(min(r,a)+ans)
a=input()
o=0
for i in range(len(a)):
  o+=1 if a[i]=='+' else o-=1
print(o)

### FIXED CODE ###

# -*- coding: utf-8 -*-
# input
a = input()
o = 0
for i in range(len(a)):
    if a[i] == '+':
        o += 1
    else:
        o -= 1
print(o)
S = list(input())
T = list(input())

i = 0
ans_cnt = 0

while i < len(S):
    i += 1
    if S[i] == T[i]:
        ans_cnt += 1

print(ans_cnt)


### FIXED CODE ###

S = list(input())
T = list(input())

i = 0
ans_cnt = 0

while i < len(S):
    if S[i] == T[i]:
        ans_cnt += 1
    i += 1

print(ans_cnt)
N,K=map(int,input().split())
A=[int(i) for i in input().split()]
cnt=[0 for i in range(N)]
for a in A:
  cnt[a-1]+=1
knd=[]
for i,c in enumerate(cnt):
  if c!=0:
    knd.append((i+1,c))
knd.sort(key=lambda x: x[1],reverse=True)
ans=0
while len(knd)<=K:
  j,d=knd.pop()
  ans+=d
print(ans)

### FIXED CODE ###

N,K=map(int,input().split())
A=[int(i) for i in input().split()]
cnt=[0 for i in range(N)]
for a in A:
  cnt[a-1]+=1
knd=[]
for i,c in enumerate(cnt):
  if c!=0:
    knd.append((i+1,c))
knd.sort(key=lambda x: x[1],reverse=True)
ans=0
while len(knd)>K:
  j,d=knd.pop()
  ans+=d
print(ans)
n = input()
if (n % 2) == 1:
  print((n // 2) + 1)
else:
  print(n // 2)


### FIXED CODE ###

n = int(input())
if (n % 2) == 1:
  print((n // 2) + 1)
else:
  print(n // 2)