Harryxun/stf_run huggingface dataset:
from math import gcd
N = int(input())
sum = 0
for i in range(1, N+1):
    for j in range(1, N+1):
		tmp=gcd(j,k);
        for k in range(1, N+1):
            sum += gcd(i, tmp)
print(sum)

### FIXED CODE ###

from math import gcd
N = int(input())
sum = 0
for i in range(1, N+1):
    for j in range(1, N+1):
        tmp=gcd(i,j)
        for k in range(1, N+1):
            sum += gcd(tmp,k)
print(sum)
import sys
input = sys.stdin.readline
n = int(input())
a = [list(map(int, input().split()))]
ans = 0
flag = True
while True:
    tmp = 0
    for j in range(n):
        if not a[j]:
            tmp += 1
            continue
        c = a[j][0]
        if c == "-":
            continue
        if j + 1 == a[c-1][0]:
            a[j][0] = "-"
            a[c-1][0] = "-"
    if tmp == n:
        print(ans)
        break
    for j in range(n):
        if a[j]:
            if a[j][0] == "-":
                a[j] = a[j][1:]
                flag = False
    if flag:
        print(-1)
        break
    else:
        ans += 1


### FIXED CODE ###

import sys
input = sys.stdin.readline
n = int(input())
a = [list(map(int, input().split())) for _ in range(n)]
ans = 0
r = set(list(range(n)))
N = n*(n-1) // 2 + 1
for _ in range(N):
    if not r:
        print(_)
        break
    ne = set()
    flag = True
    for j in r:
        if not a[j]:
            continue
        c = a[j][0]
        if c == "-":
            continue
        if j + 1 == a[c-1][0]:
            a[j][0] = "-"
            a[c-1][0] = "-"
            ne.add(j)
            ne.add(c-1)
    for j in list(ne):
        if a[j]:
            if a[j][0] == "-":
                a[j].pop(0)
                flag = False
                if not a[j]:
                    ne.remove(j)
    if flag:
        print(-1)
        break
    else:
        r = ne
n = int(input())
A = list(map(int,input().split()))
from collections import deque

B = deque([])

for i in range(n):
  if i %2:
    B.appendleft(A[i])
  else:
    B.append(A[i])
    
if n%2:
  B = B[::-1]
print(*B)

### FIXED CODE ###

n = int(input())
A = list(map(int,input().split()))
from collections import deque

B = deque([])

for i in range(n):
  if i %2:
    B.appendleft(A[i])
  else:
    B.append(A[i])
B = list(B)
if n%2:
  B = B[::-1]
print(*B)
from statistics import mean
from math import factorial
import numpy as np
N = int(input())
H = list(map(int, input().split()))
MOD = 1000000007
diff=[]
for i in range(N-1):
    diff.append(H[i+1]-H[i])

diff=np.array(diff)
multi=np.array([mean(list(range(1,i+1)))*factorial(N-1) for i in range(1,N)])
# print(multi)
# print(diff)
print(int(np.sum(diff*multi)%MOD))

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
import numpy as np
 
MOD = 10 ** 9 + 7
 
N = int(readline())
X = np.array(read().split(),np.int64)
 
def cumprod(A, MOD = MOD):
    L = len(A); Lsq = int(L**.5+1)
    A = np.resize(A, Lsq**2).reshape(Lsq,Lsq)
    for n in range(1,Lsq):
        A[:,n] *= A[:,n-1]; A[:,n] %= MOD
    for n in range(1,Lsq):
        A[n] *= A[n-1,-1]; A[n] %= MOD
    return A.ravel()[:L]
def make_fact(U, MOD = MOD):
    x = np.arange(U, dtype = np.int64); x[0] = 1
    fact = cumprod(x, MOD)
    x = np.arange(U, 0, -1, dtype=np.int64); x[0] = pow(int(fact[-1]), MOD-2, MOD)
    fact_inv = cumprod(x, MOD)[::-1]
    return fact,fact_inv
 
U = 10 ** 5 + 5
fact, fact_inv = make_fact(U)
 
inv = np.zeros(U,np.int64)
inv[1:] = fact_inv[1:] * fact[:-1] % MOD
 
coef = inv[1:N].cumsum() % MOD
 
answer = (np.diff(X) * coef % MOD).sum() % MOD
answer *= fact[N-1]; answer %= MOD
 
print(answer)
N, K = map(int, input().split())
h[] = map(int, input().split())
for i in h:
  if i > K:
    total+=1
print(total)    

### FIXED CODE ###

N, K = map(int, input().split())
h = list(map(int, input().split()))
total=0
for i in h:
  if i >= K:
    total+=1
print(total)
k=int(input())
s=list(str(input()))
if len(s)<=k:
  s=sum(s)
  print(s)
else:
  t=""
  for i in range(0,k):
    t=t+s[i]
  t=t+"..."
  print(t)

### FIXED CODE ###

k=int(input())
s=list(str(input()))
if len(s)<=k:
  t=""
  for i in s:
    t=t+i   
  print(t)
else:
  t=""
  for i in range(0,k):
    t=t+s[i]
  t=t+"..."
  print(t)
t = list(input())

i = 0
for i in size(t):
  if t[i] == '?':
    t[i] == 'D'
    
print(t)
  

### FIXED CODE ###

t = list(input())
 

for i in range(len(t)):
  if t[i] == '?':
    t[i] = 'D'
    i +=1

t = ''.join(t)
# out = []
# for i in range(len(t)):
#   out += t[i]

print(t)
n = int(input())
a = [int(_) for _ in input().split()]

a.sort(reverse=True)
ans = 0
for i in range(n-1):
    ans += a[(i+1)//2]
    # print(ans)
print(ans)


### FIXED CODE ###

MOD = 10**9+7

n, k = [int(_) for _ in input().split()]

a = [int(_) for _ in input().split()]

m = list(filter(lambda x: x < 0, a))
p = list(filter(lambda x: x > 0, a))

m.sort()
p.sort(reverse=True)


if len(p)+len(m) < k:
    print(0)
    exit()
if len(p)+len(m) == k:
    ans = 1
    for p_ in p:
        ans = (ans*p_) % MOD
    for q_ in m:
        ans = (ans*q_) % MOD
    print(ans)
    exit()

if len(p) == 0 and k % 2 == 1:
    ans = 1
    for i in range(k):
        ans = (ans*m[-i-1]) % MOD
    if 0 in a:
        ans *= 0
    print(ans)
    exit()

i, j = 0, 0
if k % 2 == 1:
    d = p.pop(-1)
m.append(0)
m.append(0)
p.append(0)
p.append(0)
# print(p, m)
ans = 1
for c in range(k//2):
    # print(i, j)
    if m[i]*m[i+1] >= p[j]*p[j+1]:
        ans = (ans*m[i]*m[i+1]) % MOD
        i += 2
    else:
        ans = (ans*p[j]*p[j+1]) % MOD
        j += 2

if k % 2 == 1:
    ans = (ans*max(p[j], d)) % MOD


if ans > MOD:
    ans -= MOD
print(ans)
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())
xls = []
uls = []
answer = 0
for _ in range(N):
    x,u = input().split()
    if u == JPY:
        money = int(x) 
    else:
        money = float(x)*380000
    answer += money



print(answer)
    
 



### FIXED CODE ###

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

N = int(input())

answer = 0
for _ in range(N):
    x,u = input().split()
    if u == "JPY":
        money = float(x) 
    else:
        money = float(x)*380000.0
    answer += money
print(answer)
def naiseki(x1,y1,x2,y2,x3,y3,x4,y4)
    if (x1-x2)*(x3-x4)+(y1-y2)*(y3-y4) == 0:
        print("YES")
    else:
        print("NO")
a = int(input())
for i in range(a):
    f = input().split()
    try:
        map(lambda:float(),f)
        x1=f[0]
        y1=f[1]
        x2=f[2]
        y2=f[3]
        x3=f[4]
        y3=[f5]
        x4=f[6]
        y4=f[7]
    naiseki(x1,y1,x2,y2,x3,y3,x4,y4)
except:
    print("NO")

    

### FIXED CODE ###

n = int(input())
for i in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4=map(float,input().split())
    print("YES" if abs((y2-y1)*(x4-x3)-(x2-x1)*(y4-y3)) < 1e-10 else "NO")
C = raw_input()
C_ord = ord(C)
print(str(C_ord+1))

### FIXED CODE ###

C = ord(raw_input())
print(chr(C+1))
s = input()
cnt = 0
ans = []
for i in range(0, len(s) - 3):
    j = i
    num = ''
    while j < len(s):
        juhuku = 0
        num += s[j]
        if int(num) % 2019 == 0 and num != '0':
            print(i, j)
            if j not in ans:
                ans.append(j)
            juhuku = ans.count(i - 1)
            cnt += 1 + juhuku
        j += 1
cnt, ans

### FIXED CODE ###

s, w = map(int, input().split())
if s <= w:
    print('unsafe')
else:
    print('safe')
a = int(input())
b = int(input())

sum = (a*2) + (b*2)
sum2 = a*b

print(sum2)
print(sum)


### FIXED CODE ###

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

print( a*b, 2*(a+b) )
n = int(input())
ans = 0
for _ in range(1, n+1):
    y = n // _
    ans += y * (y + 1) / 2 * _  
    print(int(ans))

### FIXED CODE ###

n = int(input())
ans = 0
for _ in range(1, n+1):
    y = n // _
    ans += y * (y + 1) / 2 * _  
print(int(ans))
n=int(input())
s='abcdefghijklmnopqrstuvwxyz'
bottom=[[] for i in range(10)]
bottom[0]=['a']

def solve(n):
    num=0
    while num<=n:
        num=num+1
        for base in bottom[num-1]:
            for i in s[:num+1]:
                if ord(i)-ord(base[-1])>1:continue
                bottom[num].append(base+i)

solve(n-1)
print(*bottom[n-1],sep='\n')

### FIXED CODE ###

n=int(input())
s='abcdefghijklmnopqrstuvwxyz'
bottom=[[] for i in range(10)]
bottom[0]=['a']

def solve(n):
    num=0
    while num<n:
        num=num+1
        for base in bottom[num-1]:
            for i in s[:num+1]:
                if i!='a' and chr(ord(i)-1) not in base:break
                bottom[num].append(base+i)

solve(n-1)
#print(*bottom[n-2])
print(*bottom[n-1],sep='\n')
n = input()

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

satisfaction = 0
for i in a:
  satisfaction += b[ i ]
  if i > 0:
    if a[ i ] == a[ i - 1 ] + 1:
    satisfaction += c[ i ]
print( satisfaction )

### FIXED CODE ###

n = input()
 
a = list( map( int, input().split()))
b = list( map( int, input().split()))
c = list( map( int, input().split()))
 
satisfaction = 0
for i in range( len( a )):
  a_i = a[ i ] - 1
  satisfaction += b[ a_i ]
  if i > 0:
    if a[ i ] == a[ i - 1 ] + 1:
      satisfaction += c[ a_i - 1 ]
print( satisfaction )
N,K = map(int,input().split())
H = sorted(map(int,input().split()))
for i in range(N):
    if H[i]>=K:
        count = i
        break
print(max(N-count,0))

### FIXED CODE ###

N,K = map(int,input().split())
H = sorted(map(int,input().split()))
count = N
for i in range(N):
    if H[i]>=K:
        count = i
        break
print(N-count)
a, b, c = map(int, split(input()))
print(c, a, b)

### FIXED CODE ###

a, b, c = map(int, input().split())
print(c, a, b)
N = int(input())
x,r = 1,0

while x*x <= N:
	if N%x==0:
		if x>1 and N//(x-1)==N%(x-1):
			r += x-1
		t = N//x-1
		if N//t==N%t:
			r += t
	x += 1

print(r)

### FIXED CODE ###

N = int(input())
x,r = 1,0

while x*x < N:
	if N%x==0:
		if x>1 and N//(x-1)==N%(x-1):
			r += x-1
		t = N//x-1
		if N//t==N%t:
			r += t
	x += 1

print(r)
#print(*sorted(map(int, input().split())))

s = map(int, input().split())

print(s.sort())


### FIXED CODE ###

#print(*sorted(map(int, input().split())))

print(*sorted(map(int, input().split())))
import sys,bisect as bs,collections as cl,heapq as hq
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

n,m = m()

if m == 1 or 2*n-1 == m:
    print("No")
else:
    print("Yes")
    if n == 2:
        for i in range(3):
            print(i+1)
    else:
        if m == 2:
            a = [3,2,1,4]
            ans = [i + 5 for i in range(n-2)] + a + [i + n+3 for i in range(n-3)]
        else:
            a = [m-1,m,m+1,m-2]
            i = 0
            ans = []
            for j in range(2*n-4):
                i += 1
                if i == m-2:
                    i += 4
                if j == n-1:
                    ans += a
                    i -= 1
                else:
                    ans.append(i)
        for i in range(2*n-1):
            print(ans[i])





### FIXED CODE ###

import sys,bisect as bs,collections as cl,heapq as hq
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

n,m = m()

if m == 1 or 2*n-1 == m:
    print("No")
else:
    print("Yes")
    if n == 2:
        ans = [1,2,3]
        print(jo(ans))
    else:
        if m == 2:
            a = [3,2,1,4]
            ans = [i + 5 for i in range(n-2)] + a + [i + n+3 for i in range(n-3)]
        else:
            a = [m-1,m,m+1,m-2]
            i = 0
            ans = []
            for j in range(2*n-4):
                i += 1
                if j == n-2:
                    ans += a
                    i -= 1
                else:
                    if i == m-2:
                        i += 4
                    ans.append(i)
        print(jo(ans))
S = int(input())
L = len[S]
for i in rnage(L):
    print(L)

### FIXED CODE ###

S = input()
L = len(S)
for i in range(L):
    print("x",end='')
import itertools
import sys
N,M=map(int,input().split())
dic={}
for _ in range(N):
    a,b=map(int,input().split())
    if(a in dic.keys()):
        dic[a].append(b)
    else:
        dic[a]=[b]
    if(b in dic.keys()):
        dic[b].append(a)
    else:
        dic[b]=[a]


if(M==0):
    print(0)
    sys.exit()
    
node=[i for i in range(N)]
ans=0
strokes=itertools.permutations(node,M)

def judge(A,B):
    values=dic[A]
    if(B in values):
        return True
    else:
        return False

for stroke in strokes:
    stroke=list(stroke)
    if(stroke[0]==0):
        pre=stroke.pop(0) + 1
        for s in stroke:
            if(judge(pre,s+1)==False):
                break
            pre=s+1
        else:
            ans+=1
    
print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
G = [[] for i in range(N)]
for i in range(M):
    a, b = map(int, input().split())
    G[a - 1].append(b - 1)
    G[b - 1].append(a - 1)
cnt = [0]
def dfs(V, s):
    V[s] = 1
    if sum(V) == N:
        cnt[0] += 1                    
    else:
        for adj in G[s]:
            if V[adj] == 0:             
                dfs(V[:adj] + [1] + V[adj + 1:], adj)  #ここで分岐がたくさん発生する
dfs([0] * N, 0)
print(cnt[0])
N=int(input())
a=[0 for i in range(N-1)]
b=[0 for i in range(N-1)]
c=[0 for i in range(N-1)]
VL=[dict() for i in range(N)]
for i in range(N-1):
    a[i],b[i],c[i]=map(int,input().split())
    a[i]-=1
    b[i]-=1
    VL[a[i]][b[i]]=c[i]
    VL[b[i]][a[i]]=c[i]
Q,K=map(int,input().split())
K-=1
x=[0 for i in range(Q)]
y=[0 for i in range(Q)]
for i in range(Q):
    x[i],y[i]=map(int,input().split())
    x[i]-=1
    y[i]-=1
reached=[False for i in range(N)]
dist=[0 for i in range(N)]
def dfs(v):
    reached[v]=True
    for u in VL[v]:
        if not(reached[u]):
            dist[u]=dist[v]+VL[v][u]
            dfs(u)
dfs(K)
for i in range(Q):
    print(dist[x[i]]+dist[y[i]])


### FIXED CODE ###

import queue
N=int(input())
a=[0 for i in range(N-1)]
b=[0 for i in range(N-1)]
c=[0 for i in range(N-1)]
VL=[dict() for i in range(N)]
for i in range(N-1):
    a[i],b[i],c[i]=map(int,input().split())
    a[i]-=1
    b[i]-=1
    VL[a[i]][b[i]]=c[i]
    VL[b[i]][a[i]]=c[i]
Q,K=map(int,input().split())
K-=1
x=[0 for i in range(Q)]
y=[0 for i in range(Q)]
for i in range(Q):
    x[i],y[i]=map(int,input().split())
    x[i]-=1
    y[i]-=1
reached=[False for i in range(N)]
dist=[0 for i in range(N)]
q=queue.Queue()
q.put(K)
reached[K]=True
while(not(q.empty())):
    r=q.get()
    for v in VL[r]:
        if not(reached[v]):
            q.put(v)
            dist[v]=VL[r][v]+dist[r]
            reached[v]=True
for i in range(Q):
    print(dist[x[i]]+dist[y[i]])
n=int(input())
a=input().split()
a=list(map(int,a))
i=0
ans=1
for calc in a:
    if(0 in a==True):
        print(0)
        exit()
    ans=ans*calc
    if(ans>1000000000000000000):
        print(-1)
        exit()
    i+=1
    if(i==n):
        break
if(ans>1000000000000000000):
    print(-1)
else:
    print(ans)


### FIXED CODE ###

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

print(a*b)
import bisect
def prime_list(n):
    '''
    n未満の素数のリストを返す
    '''
    num = list(range(2, n))
    prime = []
    while num[0] ** 2 < n:
        p = num.pop(0)
        for j in range(2 * p, n, p):
            if j in num:
                num.remove(j)
        prime.append(p)
    prime += num
    return prime

Q = int(input())
queries = [list(map(int, input().split())) for _ in range(Q)]
primes = prime_list(10 ** 5)
prime_2017like = []
for prime in primes:]
    if (prime + 1) // 2 in primes:
        prime_2017like.append(prime)
for i in range(Q):
    li, ri = queries[i]
    print(bisect.bisect_right(prime_2017like, ri) - bisect.bisect_right(prime_2017like, li - 1))


### FIXED CODE ###

def sieve(n):
    '''

    :param n:
    :return: n以下の素数のリストを返す
    '''
    prime = []
    is_prime = [True] * (n + 1) #is_prime[i] = Trueならiは素数
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, n+1):
        if is_prime[i]:
            prime.append(i)
            for j in range(2 * i, n + 1, i):
                is_prime[j] = False
    return is_prime

import bisect
Q = int(input())
queries = [list(map(int, input().split())) for _ in range(Q)]
primehantei = sieve(10 ** 5)
like2017 = []
for i in range(10 ** 5):
    if primehantei[i] == True and primehantei[ (i + 1) // 2] == True:
        like2017.append(i)

for i in range(Q):
    li, ri = queries[i]
    print(bisect.bisect_right(like2017, ri) - bisect.bisect_right(like2017, li - 1))
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, T = MAP()
L = [LIST() for i in range(N)]

dp = [[0] * (T) for i in range(N+1)]

L.sort()
for i in range(N):
    for j in range(T):
        if j - L[i][1] >= 0:
            dp[i+1][j] = max(dp[i+1][j], dp[i][j-L[i][0]]+L[i][1])
        dp[i+1][j] = max(dp[i+1][j], dp[i][j])
# print(dp[N][T-1])

ans = 0
for k in range(N):
    # k番目を食べずにk-1番目まで食べたT-1秒以下での最大値に，
    # k番目のものをT-1秒目に食べた値の中での最大値
    # 一番いいものを最後に食べる
    ans = max(dp[k][T-1] + L[k][1], ans)
print(ans)





### FIXED CODE ###

import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect, bisect_left, bisect_right

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, T = MAP()
A = []
B = []
L = [LIST() for i in range(N)]

# 1からi番目の料理で，j分以内に完食できるおいしさの合計の最大値
# dp1[i][j]
dp1 = [[0] * (T) for i in range(N+1)]
# # iからN番目の料理で，j分以内に完食できるおいしさの合計の最大値
# # dp2[i][j]
# dp2 = [[0] * (T) for i in range(N+1)]
# print(L)
# 昇順にする
L.sort()
for a, b in L:
    A.append(a)
    B.append(b)

for i in range(N):
    for j in range(T):
        if j - A[i] >= 0:
            dp1[i+1][j] = max(dp1[i][j-A[i]] + B[i], dp1[i+1][j])
        dp1[i+1][j] = max(dp1[i][j], dp1[i+1][j])

ans = 0
# 最後に一番時間のかかるものをT-1秒目に食べればいい
for k in range(1, N+1):
    ans = max(dp1[k-1][T-1] + B[k-1], ans)
print(ans)




exit()
for i in range(N):
    for j in range(T):
        if j - A[i] >= 0:
            dp1[i+1][j] = max(dp1[i][j-A[i]] + B[i], dp1[i+1][j])
        dp1[i+1][j] = max(dp1[i][j], dp1[i+1][j])
# やりやすく
L = L[::-1]
for i in range(N):
    for j in range(T):
        if j - A[i] >= 0:
            dp2[i+1][j] = max(dp2[i][j-A[i]] + B[i], dp2[i+1][j])
        dp2[i+1][j] = max(dp2[i][j], dp2[i+1][j])
# 戻す
L = L[::-1]
print(L)
ans = 0
for i in range(1, N+1):
    tmp = 0
    for j in range(T):
        tmp = max(tmp, dp1[i-1][j] + dp1[N-i][T-1-j])
    ans = max(ans, tmp+L[i-1][1])
print(ans)
N = int(input())
arr = list(map(int, input().split()))

i = 1
while i <= len(arr):
  while arr[i - 1] != i and i <= len(arr):
    arr.pop(i - 1)
  if arr[i - 1] == i:
    if i == len(arr):
      print(N - i)
      exit(0)
    else:
      i += 1
  else:
    print(-1)
    exit(0)

### FIXED CODE ###

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

i = 0
err = True
for num in arr:
  if num == i + 1:
    i += 1
    err = False
if err:
  print(-1)
else:
  print(N - i)
x1,y1,x2,y2 = map(int,input().split())
import numpy as np

x1 = np.array([x1,y1])
x2 = np.array([x2,y2])
rot = np.array([[0,-1],[1,0]])
x3 = np.dot(rot,(x2-x1))+x2
x4 = np.dot(rot,(x3-x2))+x3
print(x3[0],x3[1],x4[0],x4[1])

### FIXED CODE ###

x1,y1,x2,y2 = map(int,input().split())
import numpy as np

x1 = np.array([x1,y1])
x2 = np.array([x2,y2])
rot = np.array([[0,-1],[1,0]])
x3 = np.dot(rot,(x2-x1))+x2
x4 = np.dot(rot,(x3-x2))+x3
print(x3[0],x3[1],x4[0],x4[1])
N, K = list(map(int, input().split()))
l = [0] * 10 ** 5
for i in range(N):
    a, b = map(int, input().split())
    l[a] += b
count = 0
for j in range(10**5):
    count += l[j]
    if count >= K:
        print(j)
        break


### FIXED CODE ###

N, K = list(map(int, input().split()))
l = [0] * 10 ** 5
for i in range(N):
    a, b = map(int, input().split())
    l[a-1] += b
count = 0
for j in range(10**5):
    count += l[j]
    if count >= K:
        print(j+1)
        break
from math import ceil,sqrt,log,gcd
def ii():return int(input())
def si():return input()
def mi():return map(int,input().split())
def li():return list(mi())




n,m=map(int,input().split())
if(n==m):
    print("Yes")
else:
    print('No')

### FIXED CODE ###

# from math import ceil,sqrt,log,gcd
# def ii():return int(input())
# def si():return input()
# def mi():return map(int,input().split())
# def li():return list(mi())




n,m=map(int,input().split())
if(n==m):
    print("Yes")
else:
    print('No')
S = input()
K = int(input())
z = ord('z') + 1

res = ""
flg = False
for i,c in enumerate(S):
    if z - ord(c) <= K:
        res += 'a'
        K -= z-ord(c)
    else:
        res += chr(ord(c))

res = res[:-1] + chr(ord(res[-1]) + K)
print(res)


### FIXED CODE ###

S = input()
K = int(input())
z = ord('z') + 1

res = ""
flg = False
for i,c in enumerate(S):
    if c == 'a':
        res += 'a'
        continue
    elif z - ord(c) <= K:
        res += 'a'
        K -= z-ord(c)
    else:
        res += chr(ord(c))

res = res[:-1] + chr((ord(res[-1])-ord('a') + K) % 26 + ord('a'))
print(res)
n = int(input())
S = map(int, input().split())
q = int(input())
T = map(int, input().split())
 
count = 0
for key in T:
    left = 0
    right = n
    while left < right
        mid = (right - left) // 2
        if S[mid] == key:
            count = count + 1
            break
        else if key < S[mid]:
            right = mid
        else:
            left = mid + 1
print(count)

### FIXED CODE ###

n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))
 
count = 0
for key in T:
    left = 0
    right = n
    while left < right:
        mid = (right + left) // 2
        if S[mid] == key:
            count = count + 1
            break
        if key < S[mid]:
            right = mid
        else:
            left = mid + 1
print(count)