Harryxun/stf_run huggingface dataset:
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
#import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())[:-1]
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [list(input())[:-1] for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
N = int(input())
A = list(map(int,input().split()))
MAX = 10**18
if 0 in A:
    print(0)
else:
    ans = 1
    flag = 0
    for i in range(N):
        a = A[i]
        cur *= a
        if cur > MAX:
            flag = 1
            break
    if flag == 1:
        print(-1)
    else:
        print(cur)

### FIXED CODE ###

import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
#import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())[:-1]
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [list(input())[:-1] for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
N = int(input())
A = list(map(int,input().split()))
MAX = 10**18
zero = 0
for i in range(N):
    if A[i] == 0:
        zero = 1
        break
if zero == 1:
    print(0)
else:
    cur = 1
    flag = 0
    for i in range(N):
        a = A[i]
        cur *= a
        if cur > MAX:
            flag = 1
            break
    if flag == 1:
        print(-1)
    else:
        print(cur)
a=input().strip().split(" ")

b=[int(i) for i in a]

if(a[0]*a[1]>a[2]*a[3]):
    print(a[0]*a[1])
else:
    print(a[2]*a[3])


### FIXED CODE ###

a=input().strip().split(" ")

b=[int(i) for i in a]

if(b[0]*b[1]>b[2]*b[3]):
    print(b[0]*b[1])
else:
    print(b[2]*b[3])
x, y = map(int, input().split())
if y >= 2*x and y <= 4*x and y % 2 == 0 
  print("Yes")
else:
  print("No")


### FIXED CODE ###

x, y = map(int, input().split())
if y >= 2*x and y <= 4*x and y % 2 == 0:
  print("Yes")
else:
  print("No")
# C - Sum of gcd of Tuples (Easy)

import math

K = int(input())
ans = 0

for a in range(1, K + 1):
	for b in range(1, K + 1):
		ab = math.gcd(a, b)
		
		for c in range(1, K + 1):
			ans += math.gcd(ab, c))

print(ans)

### FIXED CODE ###

# C - Sum of gcd of Tuples (Easy)

import math

K = int(input())
ans = 0

for a in range(1, K + 1):
	for b in range(1, K + 1):
		for c in range(1, K + 1):
			ans += math.gcd(a, math.gcd(b, c))

print(ans)
a,b=input().split()
if (a<b):
    print("<")
elsif (a>b):
    print(">")
else:
    print("=")

### FIXED CODE ###

a, b = input().split()

if a < b:
  print('<')
elif a>b:
  print('>')
else:
  print('=')
r1,c1,r2,c2 = map(int,input().split())

mod = 10 ** 9 + 7
MAX = (10**6)*2 + 1
fac = [0] * MAX
finv = [0] * MAX
inv = [0] * MAX

def cominit():
    fac[0] = 1
    fac[1] = 1
    finv[0] = 1
    finv[1] = 1
    inv[1] = 1
    for i in range(2,MAX):
        fac[i] = fac[i-1] * i % mod
        inv[i] = mod - inv[mod%i] * (mod//i) % mod
        finv[i] = finv[i-1] * inv[i] % mod



def cmb(n,r):
    if n < 0 or r < 0 or r > n:return 0
    if r > n/2: r = n-r        
    return fac[n] * (finv[r] * finv[n-r] % mod) % mod
    
cominit()

ans = 0
for c in range(c1, c2+1):
    ans += ((r2+1)*fac[r1]*fac[c+r2+1]-r1*fac[r2+1]*fac[c+r1])*finv[c]*finv[r1]*finv[r2+1]*inv[c+1]
    ans %= mod
    
print(ans)

### FIXED CODE ###


r1,c1,r2,c2 = map(int,input().split())

mod = 10 ** 9 + 7
MAX = (10**6)*2 + 100
fac = [0] * MAX
finv = [0] * MAX
inv = [0] * MAX

def cominit():
    fac[0] = 1
    fac[1] = 1
    finv[0] = 1
    finv[1] = 1
    inv[1] = 1
    for i in range(2,MAX):
        fac[i] = fac[i-1] * i % mod
        inv[i] = mod - inv[mod%i] * (mod//i) % mod
        finv[i] = finv[i-1] * inv[i] % mod



def cmb(n,r):
    if n < 0 or r < 0 or r > n:return 0
    if r > n/2: r = n-r        
    return fac[n] * (finv[r] * finv[n-r] % mod) % mod
    
cominit()

ans = 0
for c in range(c1, c2+1):
    ans += ((r2+1)*fac[r1]*fac[c+r2+1]-r1*fac[r2+1]*fac[c+r1])*finv[c]*finv[r1]*finv[r2+1]*inv[c+1]
    ans %= mod
    
print(ans)
N = int(input())
xyh = [list(map(int, input().split())) for i in range(N)]
# print(N, xyh)

height = None
found = False
for cx in range(0, 101):
    for cy in range(0, 101):
        candidate = None
        for x, y, h in xyh:
            if h == 0: continue
            dx = abs(x - cx)
            dy = abs(y - cy)
            candidate = dx + dy + h 
            break
        
        found = True
        for x, y, h in xyh:
            if h == 0: continue
            if h + abs(x - cx) + abs(y - cy) != candidate:
                found = False
                break
        
        if found is True: break
    if found is True: break
height = candidate if candidate is not None else 0

print(cx, cy, height)


### FIXED CODE ###

N = int(input())

if N == 1:
    print('Hello World')
elif N == 2:
    A = int(input())
    B = int(input())
    add = A + B
    print(add)
N = int(input())

ans = float("inf")

A = 0
B = N
for i in range(N//2):

    A += 1
    B -= 1

    if A + B > N:
        break

    else:

        s_a = str(A)
        s_b = list(str(B))

        a = [int(i) for i in s_a]
        b = [int(i) for i in s_b]

        ans = min(ans, sum(a)+sum(BytesWarning))

print(ans)


### FIXED CODE ###

N = int(input())

ans = float("inf")

A = 0
B = N
for i in range(N//2):

    A += 1
    B -= 1

    if A + B > N:
        break

    else:

        s_a = str(A)
        s_b = list(str(B))

        a = [int(i) for i in s_a]
        b = [int(i) for i in s_b]

        ans = min(ans, sum(a)+sum(b))

print(ans)
S = input()
S1 = ''
S2 = ''
if i in range(len(S)):
    if i % 2 ==0 :
        S1 += '0'
        S2 += '1'
    else :
        S1 += '1'
        S2 += '0'
min1 = 0
for i in range(len(S)):
    if S[i] != S1[i]:
        min1 += 1
min2 = 0
for i in range(len(S)):
    if S[i] != S2[i]:
        min2 += 1 
print(min(min1,min2))


### FIXED CODE ###

S = input()
S1 = ''
S2 = ''
for i in range(len(S)):
    if i % 2 ==0 :
        S1 += '0'
        S2 += '1'
    else :
        S1 += '1'
        S2 += '0'
min1 = 0
for i in range(len(S)):
    if S[i] != S1[i]:
        min1 += 1
min2 = 0
for i in range(len(S)):
    if S[i] != S2[i]:
        min2 += 1 
print(min(min1,min2))
n,k = map(int, input().split())
a = list(map(int, input().split()))
import numpy as np
link = set()
next = a[0]
link.add(1)
while next not in link:
    link.add(next)
    next = a[next-1]
# print(next)
# print(list)

link2 = set()
next2 = a[0]
link2.add(1)
while next not in link2:
    link2.add(next2)
    next2 = a[next2-1]

ans = 0
rep = len(link)+1-len(link2)
# print(rep)
if(k > len(link2)-1):
    p = (k-len(link2)+2)%rep
    # print(p)

    # print(next)
    for i in range(len(link)-1):
        next = a[next]
else:
    for i in range(k):
        next = a[0]

ans = next
print(ans)

# for i in range(p):


### FIXED CODE ###

n,k = map(int, input().split())
a = list(map(int, input().split()))
import numpy as np
link = set()
next = a[0]
link.add(1)
while next not in link:
    link.add(next)
    next = a[next-1]

# print(next)
link2 = set()
next2 = a[0]
link2.add(1)
while next not in link2:
    link2.add(next2)
    next2 = a[next2-1]

link2.remove(next)
ans = 0

rep = len(link) - len(link2)
# print(rep)
if (len(link2) == 0):
    p = k%rep
    # print('e')
    for i in range(p+rep):
        next = a[next-1]
elif(k > len(link2)):
    # print('f')
    p = (k-len(link2))%rep
    # print(p)
    # print(next)
    for i in range(p+rep):
        next = a[next-1]
else:
    # print('d')
    next = a[0]
    for i in range(k-1):
        next = a[next-1]
# print(next)
ans = next
# print(link,link2)
print(ans)
from fractions import gcd
import math
def lcm(a,b): 
    return (a*b) / math.gcd(a,b) 
a,b = list(map(int,input().split()))
print(int(lcm(a,b)))



### FIXED CODE ###

def gcd(a,b): 
    if a == 0: 
        return b 
    return gcd(b % a, a) 

def lcm(a,b): 
    return (a*b) / gcd(a,b) 
a,b = list(map(int,input().split()))
print(int(lcm(a,b)))
l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
C = (N/(4*M))
F = m.split(' ')
print("Yes")
X = []
for item in F:
  votes = int(item)
  X.append(votes)

X.sort(reverse=True)
for i in range(M+1):
  if X[i]<C:
    print("No")
    break
  else:
    if i==M:
      print("Yes")

### FIXED CODE ###

l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
F = m.split(' ')
X = []
 
for item in F:
  votes = int(item)
  X.append(votes)

S = sum(X)
C = (S/(4*M))
X.sort(reverse=True)
if X[M-1]<C:
  print("No")
else:
  print("Yes")
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list( map(int,input().split()))
 
ans = sum(B) 
for i in range(N-1):
    if A[i+1] - A[i] ==1:
        res += C[A[i]-1]
print(ans)


### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
 
ans = sum(B) 
for i in range(N-1):
    if A[i+1] - A[i] ==1:
        ans += C[A[i]-1]
print(ans)
a, b, x = map(int, raw_input().split())

i = a
count = 0
for i in i < b + 1:
    if x%i == 0:
        count++

print count


### FIXED CODE ###

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

i = a
count = 0
count_b = 0
count_a = 0

count_b = b/x
count_a = (a-1)/x


print count_b - count_a
a,b=map(int(input().split()))
if a<10 and b<10:
    print(a*b)
else:
    print(-1)


### FIXED CODE ###

a,b=map(int,(input().split()))
if a<10 and b<10:
    print(a*b)
else:
    print(-1)
3 2
2 1

### FIXED CODE ###

H,W=list(map(int,input().split()))
h,w=list(map(int,input().split()))
print(H*W-h*W-w*H+h*w)
import numpy as np

N, K = map(int,input().split())
A = np.array(list(map(int,input().split())))
A.sort()
posi = A[A > 0]
zero = A[A = 0]
nega = A[A < 0]

# x以下の数を求める
def check(x):
    count = 0  # 積がx以下の組
    if x >= 0:
        count += len(zero) * N  # zero * N
    count += np.searchsorted(A, x // posi, side = 'right').sum()  # posi * N
    count += np.searchsorted(A, (-x - 1) // nega, side = 'left').sum()  # nega * N
    count -= np.count_nonzero(A * A <= x)  # 自分自身との組
    return count // 2  #重複を消す

# 二分探索
low = -10 ** 18
high = 10 ** 18
while low + 1 < high:
    mid = (low + high) // 2
    if check(mid) >= K:
        low = mid
    else:
        high = mid

print(low)


### FIXED CODE ###

import numpy as np

N, K = map(int,input().split())
A = np.array(list(map(int,input().split())))
A.sort()
posi = A[A > 0]
zero = A[A == 0]
nega = A[A < 0]

# 積がx以下の組を求める
def check(x):
    count = 0  # 積がx以下の組
    if x >= 0:
        count += len(zero) * N  # zero * N
    count += np.searchsorted(A, x // posi, side = 'right').sum()  # posi * N
    count += (N - np.searchsorted(A, (-x - 1) // (-nega), side = 'right')).sum()  # nega * N
    count -= np.count_nonzero(A * A <= x)  # 自分自身との組
    return count // 2  #重複を消す

# 二分探索
low = -10 ** 18
high = 10 ** 18
while low + 1 < high:
    mid = (low + high) // 2
    if check(mid) < K:  # OK
        low = mid
    else:               # NG
        high = mid

print(high)
N,A,B,C,D,E=input().split()

### FIXED CODE ###

N = int(input())
cnt = int()
A=[]
for i in range(5):
    A.append(int(input()))
A.sort()
print(-(-N//min(A))+4)
MOD = 1000000007

def dfs(par, v, val):
    for child in edges[v]:
        if child != par:
            ways[child] = max(0, val)
            val -= 1
            dfs(v, child, nColors - 2)

nVertices, nColors = map(int, input().split())
edges = [[] for _ in range(nVertices + 1)]
for _ in range(nVertices - 1):
    u, v = map(int, input().split())
    edges[u].append(v)
    edges[v].append(u)

ways = [0] * (nVertices + 1)
ways[1] = nColors
dfs(0, 1, nColors - 1)
ret = 1
for w in ways[1:]:
    ret = (ret * w) % MOD
print(ret)

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

MOD = 1000000007

def dfs(par, v, val):
    for child in edges[v]:
        if child != par:
            ways[child] = max(0, val)
            val -= 1
            dfs(v, child, nColors - 2)

nVertices, nColors = map(int, input().split())
edges = [[] for _ in range(nVertices + 1)]
for _ in range(nVertices - 1):
    u, v = map(int, input().split())
    edges[u].append(v)
    edges[v].append(u)

ways = [0] * (nVertices + 1)
ways[1] = nColors
dfs(0, 1, nColors - 1)
ret = 1
for w in ways[1:]:
    ret = (ret * w) % MOD
print(ret)
l = int(input())
A = input().split(" ")
unique = set(A)
def combination(number):
  if number <= 1:
    return 0
  else:
    return int(number * (number - 1) / 2)
def caluculate(string):
  data = memo[string]
  if data <= 1:
    return(0)
  else:
    return(data - 1) 
total = 0
memo = {}
for i in unique:
  times = A.count(i)
  memo[i] = times
  total += combination(times)
for i in A:
  print(total - caluculate(i))

### FIXED CODE ###

inp = input().split(" ")
N, M = int(inp[0]), int(inp[1])
# print(N, M)

def count(number):
  if number == 1 or number == 0:
    return 0
  else:
    return number * (number - 1) / 2

print(int(count(N) + count(M)))
import sys
input=sys.stdin.readline
#from collections import defaultdict
#d = defaultdict(int)
#import fractions
#import math
#import collections
#from collections import deque
#from bisect import bisect_left
#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [input() for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
#import itertools
def primes(n):#nまでの素数を列挙
    is_prime = [True]*(n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2,int(n**(0.5)+1)):
        if not is_prime[i]:
            continue
        for j in range(i*2,n+1,i):
            is_prime[j] = False
    return [i for i in range(n+1) if is_prime[i]]
A,B = map(int,input().split())
if A == 1 or B == 1:
    print(1)
else:
    m = min(A,B)
    pr = primes(m)
    c = 0
    if len(pr)==0:
      print(1)
    for i in pr:
        if A%i == 0 and B%i == 0:
            c += 1
        else:
          continue
    print(c+1)


### FIXED CODE ###


"""nを素因数分解"""
"""2以上の整数n => [(素因数, 指数), ...]の2次元リスト"""


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

import fractions
a, b = map(int, input().split())
li = factorization(fractions.gcd(a, b))

if li[0][0] == 1:
    print(1)
else:
    print(len(li)+1)
N = int(input())
lis_h = list(map(int, input().split()))

for i in range(N,1,-1):
    if lis_h[i - 1] < lis_h[i - 2]:
        lis_h[i - 2] -= 1
        if lis_h[i - 1] < lis_h[i - 2]:
            print("No")
            exit()
print("Yes")


### FIXED CODE ###

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

if lis[2] - (lis[0] - lis[1]) > 0:
    print(lis[2] - (lis[0] - lis[1]))
else:
    print(0)
n, m = map(int,input().split())

g = {}
for i in range(m):
    s,t = map(int,input().split())
    val = g.get(s,[])
    val.append(t)
    g[s] = val
    val = g.get(t,[])
    val.append(s)
    g[t] = val

def dfs(g, s, done=[]):
    if s in done:
        return
    done.append(s)
    for c in g[s]:
        dfs(g, c, done)
    return done

q = int(input())

n = set(g.keys())
cc = []
while n != set([]):
    t = n.pop()
    d = dfs(g, t, [])
    cc.append(d)
    n = n - set(d)

for j in range(q):
    s,t = map(int,input().split())
    k = True
    for c in cc:
        if s in c and t in c:
            print('yes')
            k = False
            break
    if k: print('no')

### FIXED CODE ###

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

g = {}
for i in range(m):
    s,t = map(int,input().split())
    val = g.get(s,[])
    val.append(t)
    g[s] = val
    val = g.get(t,[])
    val.append(s)
    g[t] = val

color = 1
done = [-1] + [-1] * n

def dfs(g, s):
    done[s] = color
    stack = [s]
    while stack != []:
        t = stack.pop()
        
        for c in g.get(t,[]):
            if done[c] == -1:
                done[c] = color
                stack.append(c)

q = int(input())

for v in range(n):
    if done[v] == -1:
        dfs(g,v)
        color += 1

for j in range(q):
    s,t = map(int,input().split())
    if done[s] == done[t]:
        print('yes')
    else: print('no')
from sys import stdin
from collections import deque


class BreadthFirstSearch:
    def __init__(self, num_nodes):
        self.n = num_nodes
        self.graph = [[] for _ in range(self.n)]

    # Edge数分回すことを想定
    def add_edge(self, start, end, undirected=True):
        self.graph[start].append(end)
        if undirected:
            self.graph[end].append(start)

    # depth = distance
    def search(self, start_node):
        order = [-1] * self.n # a bfs ordering of each vertex
        parent = [-1] * self.n # parent of each vertex in the bfs search tree
        depth = [-1] * self.n # the depth of each vertex
        q = deque([(start_node, -1, 0)]) # (vertex, parent, depth)
        num = 0 # current ordering
        while len(q) > 0:
            v, p, d = q.popleft()
            if order[v] < 0: # visited v for the first time
                order[v] = num; parent[v] = p; depth[v] = d
                num += 1
                for u in self.graph[v]:
                    if order[u] >= 0: continue
                    q.append((u, v, d+1))
        return order, parent, depth





# BFS pypyでAC
def get_result(data):
    N, X, Y = data
    _data = [[i, i+1] for i in range(1, N)]
    _data += [[X, Y]]
    bfs = BreadthFirstSearch(N)
    for val in _data:
        bfs.add_edge(val[0]-1, val[1]-1)
    dist_cnt = [0 for i in range(N)]
    for i in range(N):
        _, _, depth = bfs.search(i)
        for j in range(i, N):
            dist_cnt[depth[j]] += 1
    for i in range(1, N):
        print(dist_cnt[i])


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    get_result(data)


### FIXED CODE ###

from sys import stdin


def get_result(data):
    S = data[0]
    if S[2] == S[3] and S[4] == S[5]:
       return 'Yes'
    return 'No'


if __name__ == '__main__':
    data = list(map(str, stdin.readline().rstrip('\n').split(' ')))
    result = get_result(data)
    print(result)
a = list(map(int,input().split()))
n = len(a) - 1
for i in range(len(a)):
  temp = a[i]
  a[i] = a[n-1]
  a[n-1] = temp
  n+=1
  

### FIXED CODE ###

a = list(map(int,input().split()))
n = len(a)-1
i = 0
for _ in range(len(a)-1):
    temp = a[i]
    a[i] = a[n-1]
    a[n-1] = temp
    n+=1
for  i in a:
         print(i,end=" ")
a, b = int(input())
if min(a,b) > 0:
  print("Positive")
elif max(a,b) < 0:
  print("Negative")
else:
  print("Zero")

### FIXED CODE ###

a, b = map(int,input().split())
num = (b-a)+1
if a > 0:
  print("Positive")
elif b < 0 and num%2==0:
  print("Positive")
elif b < 0 and num%2!=0:
  print("Negative")
elif a <= 0 and b >= 0:
  print("Zero")
import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(nums):
    return reduce(lcm_base, nums, 1)

n, a = input(), list(map(int, input().split()))
l = lcm(a)
sum = 0
for aa in a:
    sum += (l-1) % aa
print(sum)


### FIXED CODE ###

from functools import reduce
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)


def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(nums):
    return reduce(lcm_base, nums, 1)

n, a = input(), list(map(int, input().split()))
l = lcm(a)
sum = 0
for aa in a:
    sum += (l-1) % aa
print(sum)
n_n = int(input())
n = map(int, raw_input().split())
n_m= int(input())
m = map(int, raw_input().split())
     
def solve(i, m):
   if m == 0:
      return True
   if i >= n_n or m > sum(n):
      return False
   res = solve(i + 1, m) or solve(i + 1,m - n[i])
   return res
      
for k in range(m_m):
   if solve(0, m[k]):
      print "yes"
   else:
      print "no"

### FIXED CODE ###

num_n = int(input())
n = map(int, raw_input().split())
num_m = int(input())
m = map(int, raw_input().split())
     
def solve(i, m):
   if m == 0:
      return True
   if i >= num_n or m > sum(n):
      return False
   res = solve(i + 1, m) or solve(i + 1,m - n[i])
   return res
      
for k in range(num_m):
   if solve(0, m[k]):
      print "yes"
   else:
      print "no"
'''
CSS
CSR
'''
prin( sum([1 for x, y in zip(input(), input()) if x == y]

### FIXED CODE ###

print( sum([1 for x, y in zip(input(), input()) if x == y]) )
import math
N=int(input())
A=list(map(int, input().split()))
A=list(map(math.fabs, A))
A.sort()
print(sum(A[1:]-A[0]))

### FIXED CODE ###

N=int(input())
A=list(map(int, input().split()))
cnt=0
for i in range(N):
  if A[i]<0:
    A[i]*=-1
    cnt+=1
A=list(map(abs, A))
A.sort()
if cnt&1==0:
  print(sum(A))
else:
  print(sum(A[1:])-A[0])
from collections import Counter
n = int(input())
word_l = list()
for _ in range(n):
  word = ''.join(sort(list(input())))
  word_l.append(word)
  
word_counter = Counter(word_l)
print('{}'.format(sum(word_counter.values()) - n))

### FIXED CODE ###

from collections import Counter
n = int(input())
word_l = list()
for _ in range(n):
  word = ''.join(sorted(list(input())))
  word_l.append(word)
  
word_counter = Counter(word_l)
print('{}'.format(sum(map(lambda x: sum(range(x)), word_counter.values()))))
import math

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))

### FIXED CODE ###

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

def gcd(m, n):
    x = max(m, n)
    y = min(m, n)
    if x % y == 0:
        return y
    else:
        while x % y != 0:
            z = x%y
            x = y
            y = z
        else:
            return z
def lcm(m, n):
    return int(m * n/gcd(m,n))

print(lcm(a,b))
x, y = map(int, input().split("  "))
X, Y = map(int, input().split("  "))
ptint{(x-X)*(y-Y)}

### FIXED CODE ###

H,W = map(int, input().split(" "))
h,w = map(int, input().split(" "))
print((H-h)*(W-w))
n,k = map(int,input().split())
count = [0]* (10**5+1)
s = set()

for i in range(n):
    a,b = map(int,input().split())
    count[a-1] += b
    s.add(a)
print(s)

x = 0
for s in sorted(S):
    x += count[s-1]
    if x >= k:
        print(s)
        break


### FIXED CODE ###

N, K = map(int, input().split())
cnt = [0]*100001
S = set()
for i in range(N):
  a, b = map(int, input().split())
  cnt[a-1] += b
  S.add(a)

acc = 0
for s in sorted(S):
  acc += cnt[s-1]
  if acc >= K:
    print(s)
    break