Harryxun/stf_run huggingface dataset:
N, X = map(int, input().split())
cities = [int(i) for i in input().split()]
cities.sort()
dist = [int(abs(i-X)) for i in cities]
dist.sort()

import math
if N==1:
    print(max(dist))
else:
    D = math.gcd(min(dist), max(dist))
    for i in reversed(range(1, D+1)): #最大公約数を1から順に考える
        for j in range(len(dist)): #全ての数を割ってみる
            if dist[j]%i != 0:
                flag = False
                break
            else:
                flag = True
        if flag:
            D = i
            break
    print(D)

### FIXED CODE ###

N, X = map(int, input().split())
cities = [int(i) for i in input().split()]
cities.sort()
dist = [int(abs(i-X)) for i in cities]
dist.sort()
 
if N==1:
    print(max(dist))
else:
    while len(dist)>0:
        m = min(dist)
        dist = [int(i%m) for i in dist]
        dist.sort()
        while len(dist)>0 and dist[0]==0:
            dist.remove(0)
        if len(dist)==0:
            break
        else:
            dist.append(m)
    print(m)
a,b = map(int,input().split(‘ ‘))
print((a - 1) * (b - 1))

### FIXED CODE ###

a,b = map(int,input().split(' '))
print((a - 1) * (b - 1))
n = int(input())
A = list(map(int,input().split()))

col = [0 for _ in range(9)]
for a in A:
  if a >= 3200:
    col[8] += 1
  col[a//400] += 1
print(sum(col[:-1]), sum(col))

### FIXED CODE ###

n = int(input())
ai = list(map(int,input().split()))
aj = list(map(lambda x:int(x/400),ai))
rainbow = 0
for e in aj:
  if e >= 8:
    rainbow += 1
ak= set(aj)
ans = 0
for e in ak:
  if e < 8:
    ans += 1
print(max(1,ans) ,end='')
print(' ' ,end = '')
print(ans+ rainbow)
input()
ms=[int(i) for i in input().split()]
c=0
=0
for m in ms:
 if m<=c:
  c=m
  d+=1
print(d)

### FIXED CODE ###

input()
ms=[int(i) for i in input().split()]
c=d=0
for m in ms:
 if c<=m:
  c=m
  d+=1
print(d)
import sys

assert sys.argv[1] == "ONLINE_JUDGE"


### FIXED CODE ###

D, T, S = map(int, input().split())
print("Yes" if T * S >= D else "No")
n = int(input())
for i in range(n):
    t,x,y = map(int,input().split())
    if (t[i]-(x[i-1]+y[i-1]))%2 == 0 or t[i] == (x[i-1] + y[i-1]):
        print('Yes')
    elif (t[i]-(x[i-1]+y[i-1]))%2 == 1:
        print('No')
    else:
        print('No')

### FIXED CODE ###

n = int(input())
a = [input().split() for l in range(n)]
b = 0
t = [0]
x = [0]
y = [0]
for i in range(n):
    t.append(a[i][0])
    x.append(a[i][1])
    y.append(a[i][2])

for k in range(n):
    o = int(t[k+1])-int(t[k])
    p = int(x[k+1])-int(x[k])
    q = int(y[k+1])-int(y[k])
    if (o >= p+q) and ((o - (p+q))%2 == 0):
        b += 1
    else:
        b = b

if b == n:
    print('Yes')
else:
    print('No')
import math

a, b, x = list(map(int, input().split()))
if a**2*b/2 < x:
    h = 2*x/(a**2)-b
    theta = math.atan(a/(b-h))
else:
    h = 2*x/a/b
    theta = math.atan(h/b)

print(90 - math.degrees(theta))


### FIXED CODE ###

import math

a, b, x = list(map(int, input().split()))
if a**2*b == x:
    theta = 90
elif a**2*b/2 > x:
    h = 2*x/a/b
    theta = math.degrees(math.atan(h/b))
else:
    h = 2*x/(a**2)-b
    theta = math.degrees(math.atan(a/(b-h)))

print(90 - theta)
n, a, b = map(int, input().split())
townpos = map(int, input().split())
step = townpos[0]
tsukare = 0
for x in townpos[1:]:
    tsukare += min((x-step)*a, b)
    step=x
print(tsukare)

### FIXED CODE ###

#listつけわすれ
n, a, b = map(int, input().split())
townpos = list(map(int, input().split()))
step = townpos[0]
tsukare = 0
for x in townpos[1:]:
    tsukare += min((x-step)*a, b)
    step=x
print(tsukare)
x,n = map(int,input().split())

arr = []
tmp = input()
num = tmp.split(' ')
num_li = [int(i) for i in num]
arr.extend(num_li)

arr.sort()

min = x
max = x

for i in range(10000):
    if len(arr) == 1:
        print(x)
        break

    min -= 1
    max += 1

    if min not in arr:
        print(min)
        break

    if max not in arr:
        print(max)
        break

### FIXED CODE ###

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

arr = []

if n == 0:
    print(x)
else:
    tmp = input()
    num = tmp.split(' ')
    num_li = [int(i) for i in num]
    arr.extend(num_li)

    for i in range(10000):

        if x - i not in arr:
            print(x - i)
            break

        if x + i not in arr:
            print(x + i)
            break
#B - Power Socket
A,B = list(map(int,input().split()))

count = 0
total_plug = 1
for i in range(1,100):
    count += 1
    total_plug += (A - 1)
    if B <= total_plug:
        break
        
print(count)

### FIXED CODE ###

S = input()
T = input()
count = 0
for i in range(3):
  if S[i] == T[i]:
    count += 1
print(count)
while -40<=int(input())<=40:
    print('yes')
print('no')


### FIXED CODE ###

if 30<=int(input()):
    print('Yes')
else:
    print('No')
N=int(input())
A=list(map(int,input().split()))
Q=int(input())

trans=[[] for _ in range(Q)]
for i in range(Q):
    B,C=map(int,input().split())
    trans[i].append(B)
    trans[i].append(C)

S=sum(A)
#まずはじめの合計求める

num=[0]
#これに数の出現回数をプロットする
for i in range(1,10**5+1):
    cnt=A.count(i)
    num[i]=cnt

for i in range(Q):
    B=trans[i][0]
    C=trans[i][1]
    change=num[B]*(C-B)
    num[C]+=num[B]
    num[B]-=num[B]
    S+=change
    print(S)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
Q = int(input())
BC = []
for i in range(Q):
    BC.append(list(map(int,input().split())))

num = [0]*(10**5+1)

S = []
 
#1 iterlation
S.append(sum(A))
for i in range(N):
    num[A[i]]+=1

    
for j in range(Q):
    if num[BC[j][0]] != 0:
        #Bに当たる交換するものがある時
        B = BC[j][0]
        C = BC[j][1]
        S.append(S[-1] + (C - B)*num[B] )
        #S[-1]で合計の一番最新のもの
        dammy = num[B]
        num[B] = 0
        num[C] += dammy
 
    else:
        B = BC[j][0]
        C = BC[j][1]
        S.append(S[-1])

        
for i in range(1,Q+1):
    print(S[i])
x,a,b=map(int, input().split())

if b<=a:
  print("delicious")
elif a+x>b:
  print("dangerous")
else:
  print("safe"

### FIXED CODE ###

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

if b<=a:
  print("delicious")
elif a+x>=b:
  print("safe")
else:
  print("dangerous")
N,K = map(int, input().split())
A = list(map(int, input().split()))
num = 1
num_b = None
data = []
for j in range(K):
    for t in range(j, j+3):
        num = num*A[t]
    data.append(num)
    num_b = num
    num = 1
for i in range(N - K):
    if data[i+1] > data[i]:
        print("Yes")
    elif data[i+1] <= data[i]:
        print("No")


### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n-k):
    print("Yes")if a[i]<a[k+i] else print("No")
N = int(input())

a = list(map(int,input().split())
print(abs(max(a)-min(a))
         
         

### FIXED CODE ###

N = int(input())

a = list(map(int, input().split()))
print(abs(max(a) - min(a)))
# coding: utf-8
# Your code here!
def dfs(num):
    temp=K-len(way[num])
    
    for w in way[num]:
        if visited[w]==0:
            visited[w]=temp
            temp+=1
            dfs(w)
    
    return 

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

mod=10**9+7

visited=[0]*N
way=[[] for i in range(N)]

for _ in range(N-1):
    a,b=map(int,input().split())
    way[a-1].append(b-1)
    way[b-1].append(a-1)
    
color=[]
visited[0]=K
dfs(0)

#print(visited)
ans=1
for item in visited:
    ans*=item
    ans%=mod
print(ans)


### FIXED CODE ###

# coding: utf-8
# Your code here!
import sys

sys.setrecursionlimit(10**9)

def dfs(num):
    temp=K-len(way[num])
    
    for w in way[num]:
        if visited[w]==-1:
            visited[w]=temp
            temp+=1
            dfs(w)
    
    return 

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

mod=10**9+7

visited=[-1]*N
way=[[] for i in range(N)]

for _ in range(N-1):
    a,b=map(int,input().split())
    way[a-1].append(b-1)
    way[b-1].append(a-1)
    
color=[]
visited[0]=K
dfs(0)

#print(way)
#print(visited)
ans=1
for item in visited:
    ans*=item
    ans%=mod
print(ans)
n, k = map(int, input().split())
mod = 10 ** 9 + 7
adjacent_list = [[] for i in range(n+1)]
for i in range(n - 1):
    a, b = map(int, input().split())
    adjacent_list[a].append(b)
    adjacent_list[b].append(a)
finished = set([1])
ans = k
def dfs(current, finished,num):
    global ans
    global k
    unsearched = set(adjacent_list[current]) - finished
    num = max(k - 1, num)
    if len(unsearched) == 0:
        return
    for i in unsearched:
        finished.add(i)
        num -= 1
        ans *= num
        ans %= mod
        dfs(i,finished, num)
dfs(1,finished,k)
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**5)
n, k = map(int, input().split())
mod = 10 ** 9 + 7
adjacent_list = [[] for i in range(n+1)]
for i in range(n - 1):
    a, b = map(int, input().split())
    adjacent_list[a].append(b)
    adjacent_list[b].append(a)
finished = set([1])
ans = k
def dfs(current, finished,num):
    global ans
    global k
    unsearched = set(adjacent_list[current]) - finished
    num = max(k - 1, num)
    if len(unsearched) == 0:
        return
    for i in unsearched:
        finished.add(i)
        num -= 1
        ans *= num
        ans %= mod
        dfs(i,finished, num)
dfs(1,finished,k)
print(ans)
n = int(input())

a = n%1000
b = 1000-a
if b=1000:
  print(0)
else:
  print(a)

### FIXED CODE ###

n = int(input())
 
a = n%1000
b = 1000-a
if b==1000:
  print(0)
else:
  print(b)
try:
    from functools import lru_cache
except ImportError:
    # For Python2
    # pip install backports.functools_lru_cache
    from backports.functools_lru_cache import lru_cache

class Knapsack(object):
    """
    Maximize sum of selected weight.
    Sum of selected size is les than capacity.
    Algorithm: Dynamic Optimization
    ----
    import knapsack
    size = [21, 11, 15, 9, 34, 25, 41, 52]
    weight = [22, 12, 16, 10, 35, 26, 42, 53]
    capacity = 100
    knapsack.knapsack(size, weight).solve(capacity)
    """
    def __init__(self, size, weight):
        self.size = size
        self.weight = weight

    @lru_cache()
    def solve(self, cap, i=0):
        if cap < 0: return -sum(self.weight), []
        if i == len(self.size): return 0, []
        res1 = self.solve(cap,  i + 1)
        res2 = self.solve(cap - self.size[i], i + 1)
        res2 = (res2[0] + self.weight[i], [i] + res2[1])
        return res1 if res1[0] >= res2[0] else res2


def E():
    N = int(input())
    A, B = [], []

    C = 0
    s = []
    w = []
    ans = 0

    for _ in range(N):
        a, b = list(map(int, input().split(' ')))
        if a <= b:
            C += (b - a)
            ans += b
        else:
            s.append(a - b + 1)
            w.append(b)

        A.append(a)
        B.append(b)

    # print(C, s, w)

    if A == B:
        print(0)

    else:
        _ans, _ = Knapsack(s, w).solve(C)
        print(ans + _ans)


if __name__ == '__main__':
    E()

### FIXED CODE ###

def E():
    N = int(input())

    sum_ = 0
    c = -1

    for _ in range(N):
        a, b = list(map(int, input().split(' ')))
        if a > b:
            if c == -1:
                c = b
            elif b < c:
                c = b
            
        sum_ += a

    if c == -1:
        print(0)
    else:
        print(sum_ - c)
        
if __name__ == '__main__':
    E()
N X = map(int, input().split())
m = [int(input()) for i in range(N)]

X -= sum(m)
if X > 0:
	print( N + X//min(m))
else:
  print(N)

### FIXED CODE ###

N, X = map(int, input().split())
m = [int(input()) for i in range(N)]
 
X -= sum(m)
if X > 0:
	print( N + X//min(m))
else:
  print(N)
import sys
import copy
import math
import fractions

import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
import numpy as np
from decimal import *
sys.setrecursionlimit(10 ** 6)

def CalcList(list):
    bfnum = -1
    afterList =[]
    for i in list:
        if bfnum == -1:
            bfnum = i
        else:
            now = abs(i -bfnum)
            if now >0:
                afterList.append(now)
            bfnum = i
    return afterList

def CheckList(list):
    bfnum = -1
    count = 0
    afterList =[]
    for i in list:
        if bfnum == -1:
            bfnum = i
            afterList.append(i)
        else:
            if i == bfnum:
                count = count +1
                if count < 3:
                    afterList.append(i)
            else:
                afterList.append(i)
    return afterList


if __name__ == '__main__':
    n = int(input())
    s = input()
    list =list(map(lambda x: int(x), s))

    while(len(list) >1):
        list = CalcList(list)

    if len(list) ==0:
        print(0)
    else:
        print(list[0])

### FIXED CODE ###

import sys
import copy
import math
import fractions

import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
import numpy as np
from decimal import *

maiz = []
maxh = 0
maxw = 0


def CheckCost(h, w):
    if h + 1 < maxh:
        if costList[h + 1][w] == -1 or costList[h + 1][w] > costList[h][w] + CheckColum(h + 1, w ,maiz[h][w]):
            costList[h + 1][w] = costList[h][w] + CheckColum(h + 1, w ,maiz[h][w])
            CheckCost(h + 1, w)

    if w + 1 < maxw:
        if costList[h][w + 1] == -1 or costList[h][w + 1] > costList[h][w] + CheckColum(h, w + 1,maiz[h][w]):
            costList[h][w + 1] = costList[h][w] + CheckColum(h, w + 1,maiz[h][w])
            CheckCost(h, w + 1)


def CheckColum(h, w ,s):
    if maiz[h][w] == "#" and s == ".":
        return 1
    else:
        return 0


if __name__ == '__main__':
    h, w = map(int, input().split())
    maxh = h
    maxw = w
    costList = []
    for i in range(h):
        costList.append([-1] * w)

    for i in range(h):
        s = input()
        maiz.append(list(map(lambda x: x, s)))
    if maiz[0][0] == "#":
        costList[0][0] = 1
    else:
        costList[0][0] = 0

    CheckCost(0, 0)

    print(costList[h - 1][w - 1])
N = int(input())
H = list(map(int,input().split())) + [0]
dp = [-1]*N

def dfs(pos):
  if pos >= N:
    return 99999999
  if pos == N-1:
    return 0
  if dp[pos] != -1:
    return dp[pos]
  s1 = dfs(pos+1) + abs(H[pos+1] - H[pos])
  s2 = dfs(pos+2) + abs(H[pos+2] - H[pos])
  dp[pos] = min(s1, s2)
  return dp[pos]

print(dfs(0))

### FIXED CODE ###

N = int(input())
h = [int(i) for i in input().split()]+[0 for _ in range(2)]
dp = [float('inf') for _ in range(N+2)]

dp[0] = 0
for i in range(N-1):
  dp[i+1] = min(dp[i]+abs(h[i]-h[i+1]), dp[i+1])
  dp[i+2] = min(dp[i]+abs(h[i]-h[i+2]), dp[i+2])
print(dp[N-1])
a=input()

if a[-1]=='3':
    print('bon')
elif a[-1]=='0' or a[-1]=='1' or a[-1]=='6' or a[-1]=='8'
    print('pon')
elif a[-1]=='2' or a[-1]=='4' or a[-1]=='5' or a[-1]=='7' or a[-1]=='9'
    print('hon')


### FIXED CODE ###

a=input()

if a[-1]=='3':
    print('bon')
elif a[-1]=='0' or a[-1]=='1' or a[-1]=='6' or a[-1]=='8':
    print('pon')
elif a[-1]=='2' or a[-1]=='4' or a[-1]=='5' or a[-1]=='7' or a[-1]=='9':
    print('hon')
import sys
sys.setrecursionlimit(1000000000000000)
def doritto(vrijednost):
    global kameni
    global memo
    if memo[vrijednost] != -1:
        return memo[vrijednost]
    if vrijednost == len(kameni) -2:
        return abs(kameni[vrijednost] - kameni[vrijednost+1])
    elif vrijednost == len(kameni) -1:
        return 0
    else:
        memo[vrijednost] = min(abs(kameni[vrijednost] - kameni[vrijednost+1]) + doritto(vrijednost+1),abs(kameni[vrijednost] - kameni[vrijednost+2]) + doritto(vrijednost+2))
        return memo[vrijednost]
N = int(input())
kameni = list(map(int,input().split()))
memo = []
for i in range(N):
    memo.append(-1)
print(doritto(0))

### FIXED CODE ###

import sys
sys.setrecursionlimit(200000)
def doritto(vrijednost):
    global kameni
    global memo
    if memo[vrijednost] != -1:
        return memo[vrijednost]
    if vrijednost == len(kameni) -2:
        return abs(kameni[vrijednost] - kameni[vrijednost+1])
    elif vrijednost == len(kameni) -1:
        return 0
    a = abs(kameni[vrijednost] - kameni[vrijednost+1]) + doritto(vrijednost+1)
    b = abs(kameni[vrijednost] - kameni[vrijednost+2]) + doritto(vrijednost+2)
    memo[vrijednost] = min(a,b)
    return memo[vrijednost]
N = int(input())
kameni = list(map(int,input().split()))
memo = []
for i in range(N):
    memo.append(-1)
print(doritto(0))
N = int(input())
S = [s for _ in input().split()]

ans = "Three"

for s in S:   
    if s == "Y":
        ans = "Four"
        break
print(ans)


### FIXED CODE ###

N = int(input())
S = input().split()             

ans = "Three"

for s in S:   
    if s == "Y":
        ans = "Four"
        break
print(ans)
def main():
    b = []
    line = input().split(" ")
    H = int(line[0])
    W = int(line[1])
    for l in range(H):
        b.append(input())

    result = []
    for i, line in enumerate(b):
        result_row = ""
        for j, c in enumerate(line):
            if c == ".":
                n = count(i, j, b, H, W)
                result_row += str(n)
            else:
                result_row += b[i][j]
        result.append(result_row)

    for l in result:
        print(l)


def count(row, column, board, H, W):
    n = 0
    rs, re = judge_row(row, H)
    cs, ce = judge_col(column, W)
    for r in range(rs, re):
        for c in range(cs, ce):
            if board[r][c] == "#":
                n += 1
    return n


def judge_row(row, H):
    if row == 0:
        return row, row+1+1 
    elif row == H-1:
        return row-1, row+1
    else:
        return row-1, row+1+1


def judge_col(col, W):
    if col == 0:
        return col, col+1+1 
    elif col == W-1:
        return col-1, col+1
    else:
        return col-1, col+1+1


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    b = []
    line = input().split(" ")
    H = int(line[0])
    W = int(line[1])
    for l in range(H):
        b.append(input())

    result = []
    for i, line in enumerate(b):
        result_row = ""
        for j, c in enumerate(line):
            if c == ".":
                n = count(i, j, b, H, W)
                result_row += str(n)
            else:
                result_row += b[i][j]
        result.append(result_row)

    for l in result:
        print(l)


def count(row, column, board, H, W):
    n = 0
    rs, re = judge_row(row, H)
    cs, ce = judge_col(column, W)
    for r in range(rs, re):
        for c in range(cs, ce):
            if board[r][c] == "#":
                n += 1
    return n


def judge_row(row, H):
    if H == 1:
        return 0, 1
    elif row == 0:
        return row, row+1+1 
    elif row == H-1:
        return row-1, row+1
    else:
        return row-1, row+1+1


def judge_col(col, W):
    if W == 1:
        return 0, 1
    elif col == 0:
        return col, col+1+1 
    elif col == W-1:
        return col-1, col+1
    else:
        return col-1, col+1+1


if __name__ == "__main__":
    main()
temp=input()
S=list(temp)
counter1=0
counter2=0
counter3=0 
i=len(S)-1

while True:
    if S[i-1]=='B' and S[i]=='W':
        S[i-1]='W'
        S[i]='B'
        counter1 +=1
    i -=1
    if i ==0:
        if counter1==counter2:
            break
        counter2=counter1
        for j in range(len(S)):
            if S[j]=='W':
                counter3 =j
            j -=1
        i= counter3

print(counter1)


### FIXED CODE ###

S=input()
counter=0
result = 0

for i in range(len(S)):
    if S[i]=='B':
        counter+=1
    else:
        result +=counter

print(result)
def gcd(a, b):
  if(a == b):
    return a
  elif(a > b):
    return gcd(a- b, b)
  elif(a < b):
    return gcd(a, b- a)
          

def ggcd(lista):
  if(len(lista) == 1):
    return lista.pop()
  else:
    l = lista.pop()
    for i in range(1, len(lista)):
      l = gcd(l, lista.pop())
    return l

N, X = map(int, input().split())
x = list(map(int, input().split()))
d = []
gcds = set({abs(X- x[0])})
x.sort()

for i in range(N- 1):
  d.append(x[i+ 1]- x[i])
  
d.append(abs(X- x[0]))

for i in range(N- 1):
  if(d[i+ 1] != d[i]):
    gcds.add(d[i+ 1])

print(ggcd(gcds))

### FIXED CODE ###

def gcd(a, b):
  if(a == b):
    return a
  elif(a % b == 0):
    return b
  elif(b % a == 0):
    return a
  elif(a == 1 or b == 1):
    return 1
  elif(a > b):
    return gcd(a- a// b* b, b)
  elif(a < b):
    return gcd(a, b- b// a* a)

def ggcd(lista):
  if(len(lista) == 1):
    return lista.pop()
  else:
    l = lista.pop()
    for i in range(1, len(lista)):
      l = gcd(l, lista.pop())
    return l

N, X = map(int, input().split())
x = list(map(int, input().split()))
x.append(X)
d = []
gcds = set()
x.sort()

for i in range(N):
  d.append(x[i+ 1]- x[i])

gcds.add(d[0])

for i in range(N- 1):
  if(d[i+ 1] != d[i]):
    gcds.add(d[i+ 1])

print(ggcd(gcds))
while true:
	a,op,b = raw_input().split()
	if op == '?':
		break
	elif op == '+':
		print int(a) + int(b)
	elif op == '-':
		print int(a) - int(b)
	elif op == '*':
		print int(a) * int(b)
	else:
		print int(a) / int(b)

### FIXED CODE ###


while True:
	a,op,b = raw_input().split()
	if op == '?':
		break
	elif op == '+':
		print int(a) + int(b)
	elif op == '-':
		print int(a) - int(b)
	elif op == '*':
		print int(a) * int(b)
	else:
		print int(a) / int(b)
# -*- coding: utf-8 -*-
a = int(input())
b = input().split()
c = input().split()

for i in range(a):
    b[i] = int(b[i])
    c[i] = int(c[i])

out = "Yes"

def check_max(l, num):
    max_num = 0
    max_i = -1

    l_sorted = sorted(l)
    num_list = [-1] * num
    num_list2 = [-1] * num

    for i in reversed(range(num)):
        for j in range(num):
            if l_sorted[i] == l[j]:
                if num_list[j] == -1:
                    num_list[j] = i+1
                    num_list2[i] = j
                    break

    return (num_list, list(reversed(num_list2)))

def checklist(l1, l2, num):
    result = True
    for i in range(num):
        if l1[i] > l2[i]:
            result = False
            break
    return result 


if out == "Yes":
    swap_num = 0

    num_list_b, num_list_b_index = check_max(b,a)
    num_list_c, num_list_c_index = check_max(c,a)



    for i in range(a-2):
        index1 = num_list_b_index[i]
        index2 = num_list_c_index[i]


        

        if b[index1] <= c[index2]:
            b[index1], b[index2] = b[index2], b[index1]

if not checklist(b, c, a):
    out = "No"
else:
    out = "Yes"

print(out)

### FIXED CODE ###

# -*- coding: utf-8 -*-
a = int(input())

if a % 2 == 0:
    r = a/2 -1
else:
    r = (a-1)/2

print("{}".format(int(r)))
#distance
import math
x1,y1,x2,y2=map(int,input().split())
distance = math.sqru((x2-x1)**2+(y2-y1)**2)
print(distance)

### FIXED CODE ###

#distance
import math
x1,y1,x2,y2=map(float,input().split())
distance = math.sqrt((x2-x1)**2+(y2-y1)**2)
print(distance)
N,K = map(int,input().split())
K_A = []
for i in range(N):
	K_A.append(list(map(int,input().split())))

l = []

for i in range(N):
	del K_A[i][0]
	for j in range(len(K_A[i])):
		l.append(K_A[i][j])
		
count = 0

for i in range(K+1):
	if l.count(i) == N:
		count  += 1

print(count)


### FIXED CODE ###

A,B = map(int,input().split())
if B % A == 0:
	print(A+B)
else:
	print(B-A)
H,W=map(int,input().split())
endmap=[list(s for s in input()) for _ in range(H)]
exlarge=[[0]*(W+2)*(H+2)]
ans='Yes'
for i in range(H):
  for j in range(W):
    if endmap[i][j]=='#':
      exlarge[i+1][j+1]=1

for k in range(H+2):
  for l in range(W+2):
    if endmap[i][j]==1: 
        if endmap[i][j-1]!=1 or endmap[i][j+1]!=1 or endmap[i-1][j]!=1 or endmap[i+1][j]!=1:
          ans='No'

print(ans)
    
        

### FIXED CODE ###

H,W=map(int,input().split())
endmap=[list(s for s in input()) for _ in range(H)]
exlarge=[[0]*(W+2) for _ in range(H+2)]
ans='Yes'
for i in range(H):
  for j in range(W):
    if endmap[i][j]=='#':
      exlarge[i+1][j+1]=1
 
for k in range(H+2):
  for l in range(W+2):
    if exlarge[k][l]==1 and exlarge[k][l-1]== exlarge[k][l+1]==exlarge[k-1][l]==exlarge[k+1][l]==0:
          ans='No'
 
print(ans)