Harryxun/stf_run huggingface dataset:
N,K = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
for i in range(N):
    i = N-i-1
    for j in range(K):
        if j < a[i]:
            dp[i][j] = dp[i+1][j]
        else:
            dp[i][j] = max(dp[i+1][j],dp[i+1][j-a[i]]+a[i])
print(0)

### FIXED CODE ###

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

def f(N,K,a):
    a.sort()
    if a[0] >= K:
        print(0)
        exit()

    a = [a[i] for i in range(N) if a[i]<K]
    N = len(a)
    ans = N
    dp = [False]*K
    dp[0] = True
    Smax = 0
    for i,a_ in reversed(list(enumerate(a))):
        if Smax + a_ >= K:
            ans = i
        updated = True
        for j in range(min(Smax,K-a_-1),-1,-1):
            if dp[j]:
                dp[j+a_]=True
                if updated:
                    Smax = max(Smax,j+a_)
                    updated = False
    return ans

print(f(N,K,a))
cand = list(set([2**x * 5**y for x in range(18)
                 for y in range(8) if 2**x * 5**y <= 200000]))
cand.sort()


def f(n):
    cnt = 0
    while True:
        x = n * cand[cnt]
        if x.is_integer():
            return cand[cnt]
        else:
            cnt += 1


def div(n, bl=True):
    if bl and not n.is_integer():
        return (0, 0)
    else:
        n = int(n)
        two = format(n, 'b')[::-1].find('1')
        n = n >> two
        cnt = 0
        while n % 5 == 0:
            n //= 5
            cnt += 1
        return (two, cnt)


n = int(input())
arr = [float(input()) for _ in range(n)]

x = [div(x) for x in arr]
y = [div(x, False) for x in [f(x) for x in arr]]
z = [div(x * 2**y1 * 5**z, False) for x, (y1, z) in zip(arr, y)]


ans = 0
for i in range(len(y)):
    for j in range(i + 1, len(y)):
        (a, b), (c, d) = y[i], y[j]
        if a == 0 and b == 0 and c == 0 and d == 0:
            ans += 1
        elif a + c <= z[i][0] + z[j][0] and b + d <= z[i][1] + z[j][1]:
            ans += 1

print(ans)

### FIXED CODE ###

def div(n, d):
    cnt = 0
    while n % d == 0 and cnt < 18:
        n //= d
        cnt += 1
    return cnt


n = int(input())
dp = [[0]*19 for _ in range(19)]

ans = 0
for _ in range(n):
    x = round(float(input()) * pow(10, 9))
    two = div(x, 2)
    five = div(x, 5)
    ans += dp[18 - two][18 - five]
    for i in range(two + 1):
        for j in range(five + 1):
            dp[i][j] += 1

print(ans)
a,b = map(int, input().split())
c = 1
if b == 1:
  ans = 0
else:
  for i in range(11):
    c = c-1 + a
    if c >= b:
      ans = i
      break
print(ans)

### FIXED CODE ###

a,b = map(int, input().split())
c = 1
ans = 0
if b == 1:
  ans = 0
else:
  for i in range(21):
    c = c-1 + a
    if c >= b:
      ans = i + 1
      break
print(ans)
n,l=map(int,input().split())
l1=list(int(l)+i-1 for i in range(1,n+1))
l2=100
n1=sum(l1)

for i in range(1,n+1):
    if l2>abs(int(l)+i-1):
        l2=abs(int(l)+i-1)
        x=i

print(n1-l1[x-1])


### FIXED CODE ###

n,l=map(int,input().split())
l1=list(int(l)+i-1 for i in range(1,n+1))
n1=sum(l1)
ans=min(l1,key=abs)

print(n1-(ans))
n, q = map(int, input().split())
s = input()
lr = [list(map(int, input().split())) for _ in range(q)]

for i in range(q):
    print(s[lr[i][0] - 1:lr[i][1]])
    print(s[lr[i][0] - 1:lr[i][1]].count('AC'))

### FIXED CODE ###

n, q = map(int, input().split())
s = input()
lr = [list(map(int, input().split())) for _ in range(q)]
ac_list = [0] * (n+1)
for i in range(n):
    ac_list[i+1] = ac_list[i] + (1 if s[i:i+2] == 'AC' else 0)
# print(ac_list)
for i in range(q):
    print(ac_list[lr[i][1]-1] - ac_list[lr[i][0]-1])
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 21 20:39:09 2019

@author: Yamazaki Kenichi
"""

N,K = map(int,input().split())
A = [list(map(int,input().split())) for i in range(N)]

A.sort(reverse = True,key=lambda x:x[1])
eat,noteat =[],[]
a = [0 for i in range(N+1)]
k = K
for i in range(N):
    if k == 0:
        break    
    if a[A[i][0]] ==0:
        a[A[i][0]] = 1
        eat.append(A[i][1])
        k -= 1
    else:
        noteat.append(A[i][1])
ans = [0 for i in range(min(K-k,len(noteat))+2)]
ans[0] = sum(eat)+ sum(noteat[:k])+ pow(K-k,2)

for i in range(1,min(K-k,len(noteat)+1)):
#    if pow(K-k,2)+eat[-i] < pow(K-k-i,2)+noteat[k:][i-1]:
    ans[i] = ans[i-1]-(pow(K-k,2)+eat[-i]) +(pow(K-k-i,2)+noteat[k:][i-1])
#    else:
#        break
print(max(ans))


### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Mon Jan 21 20:39:09 2019

@author: Yamazaki Kenichi
"""

N,K = map(int,input().split())
A = [list(map(int,input().split())) for i in range(N)]

A.sort(reverse = True,key=lambda x:x[1])
eat,noteat =[],[]
a = [0 for i in range(N+1)]
k = K
for i in range(N):
    if k != 0:
        if a[A[i][0]] ==0:
            a[A[i][0]] = 1
            eat.append(A[i][1])
            k -= 1
        else:
            noteat.append(A[i][1])
    else:
        noteat.append(A[i][1])
        
ans = [0 for i in range(min(K-k,len(noteat))+2)]
ans[0] = sum(eat)+ sum(noteat[:k])+ pow(K-k,2)

for i in range(1,min(K-k,len(noteat[k:])+1)):
    ans[i] = ans[i-1]-(pow(K-k-(i-1),2)+eat[-i]) +(pow(K-k-i,2)+noteat[k+i-1])

print(max(ans))
N = int(input())
ans = []
for i in range(N):
    num = int(input())
    check = ans.count(num)
    if check == 0:
        ans.append(num)
    else:
        ans.pop(check)
print(len(ans))

### FIXED CODE ###

N = int(input())
ans = set()
for i in range(N):
    num = int(input())
    if num in ans:
        ans.remove(num)
    else:
        ans.add(num)
print(len(ans))
a,b = map(int,input().split())
now=1
ans=0
while now < b:
  for i in range(21):
    now = naw - 1 + a
    ans += 1
print(ans)

### FIXED CODE ###

a,b = map(int,input().split())
now=1
ans=0
while now < b:
  now = now - 1 + a
  ans += 1
print(ans)
import math
N, K = map(int,input().split())

def comb(n, r):
    return math.factorial(n) // (math.factorial(n-r) * math.factorial(r))

for i in range(K):
    print(comb(N-K+1, i+1)*comb(K-1, i) % 1000000007)

### FIXED CODE ###

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

def comb(n, r):
    return math.factorial(n) // (math.factorial(n-r) * math.factorial(r))


for i in range(K):
    if N-K < i:
        print(0)
    else:
        print(comb(N-K+1, i+1)*comb(K-1, i) % 1000000007)
n = int(input())
a = list(map(int,input().split()))

b = []
for i,e in enumerate(a):
  b.append(e,i+1)
  
sort(b)

for i,t in enumerate(b):
  if i == n-1:
    print(t[0])
  else:
    print(t[0],end=' ')

### FIXED CODE ###

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

b = []
for i,e in enumerate(a):
  b.append((e,i+1))
  
b.sort()

for i,t in enumerate(b):
  if i == n-1:
    print(t[1])
  else:
    print(t[1],end=' ')
a,b=map(int,input().split(" "))
print(max(0a-*b))

### FIXED CODE ###

a,b=map(int,input().split(" "))
print(max(0,a-2*b))
n,k=map(int,input().split())
H=sorted([int(input()) for i in range(n)])
print(min(h[i+k-1]-h[i] for i in range(n-k+1)))


### FIXED CODE ###

n,k=map(int,input().split())
h=sorted([int(input()) for i in range(n)])
print(min([h[i+k-1]-h[i] for i in range(n-k+1)]))
a,b,c=map(int,input().split())
d=[]
for i in range(a,b+1):
	d.append(i)
#print(d)
e=[]
if c<b:
	for i in range(c):
		e.append(d[i])
		e.append(d[-i-1])
else:
	for i in d:
		print(i)
for i in sorted(set(e)):
	print(i)


### FIXED CODE ###

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

if b-a+1>2*c:
	x=[i for i in range(a,a+c)]
	y=[i for i in range(b-c+1,b+1)]
	e=x+y
else:
	e=[i for i in range(a,b+1)]
#print(e)
for i in e:
	print(i)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

W = list(map(int,read().rstrip()))

N = len(W)

def Z_Algorithm(S):
    # 共通接頭辞の長さを返す
    N=len(S)
    arr = [0]*N
    arr[0] = N
    i,j = 1,0
    while i<N:
        while i+j<N and S[j]==S[i+j]:
            j += 1
        arr[i]=j
        if not j:
            i += 1
            continue
        k = 1
        while i+k<N and k+arr[k]<j:
            arr[i+k] = arr[k]
            k += 1
        i += k; j -= k
    return arr

def find_good_substr(W):
    Z = Z_Algorithm(W)
    is_good = [True]*N
    for n in range(1,(N+1)//2):
        # n文字での周期をもってくる
        L=Z[n]
        if L<n:
            continue
        for i in range(n+n,L+n+1,n):
            is_good[i-1] = False
    return is_good

def solve():
    G1 = find_good_substr(W)
    G2 = find_good_substr(W[::-1])
    if G1[-1]:
        # 自分自身がoptimal
        return 1,1

x,y = solve()
print(x)
print(y)

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

W = list(map(int,read().rstrip()))

N = len(W)

def Z_Algorithm(S):
    # 共通接頭辞の長さを返す
    N=len(S)
    arr = [0]*N
    arr[0] = N
    i,j = 1,0
    while i<N:
        while i+j<N and S[j]==S[i+j]:
            j += 1
        arr[i]=j
        if not j:
            i += 1
            continue
        k = 1
        while i+k<N and k+arr[k]<j:
            arr[i+k] = arr[k]
            k += 1
        i += k; j -= k
    return arr

def find_good_substr(W):
    Z = Z_Algorithm(W)
    is_good = [True]*(N+1) # 長さをインデックス
    for n in range(1,N//2+1):
        # n文字での周期をもってくる
        if not is_good[n]:
            continue
        for i in range(n+n,Z[n]+n+1,n):
            is_good[i] = False
    return is_good

def solve():
    G1 = find_good_substr(W)
    G2 = find_good_substr(W[::-1])[::-1]
    if G1[-1]:
        # 自分自身がoptimal
        return 1,1
    if len(set(W)) == 1:
        return N,1
    # 2個にできるはず
    x = sum(x and y for x,y in zip(G1[1:-1],G2[1:-1]))
    return 2,x

x,y = solve()
print(x)
print(y)
import sys
sys.setrecursionlimit(10**8)

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

#####segfunc#####
def segfunc(x, y):
    return max(x, y)
#################

#####ide_ele#####
ide_ele = 0
#################

class SegTree:
    """
    init(init_val, ide_ele): 配列init_valで初期化 O(N)
    update(k, x): k番目の値をxに更新 O(logN)
    query(l, r): 区間[l, r)をsegfuncしたものを返す O(logN)
    """
    def __init__(self, init_val, segfunc, ide_ele):
        """
        init_val: 配列の初期値
        segfunc: 区間にしたい操作
        ide_ele: 単位元
        n: 要素数
        num: n以上の最小の2のべき乗
        tree: セグメント木(1-index)
        """
        n = len(init_val)
        self.segfunc = segfunc
        self.ide_ele = ide_ele
        self.num = 1 << (n - 1).bit_length()
        self.tree = [ide_ele] * 2 * self.num
        # 配列の値を葉にセット
        for i in range(n):
            self.tree[self.num + i] = init_val[i]
        # 構築していく
        for i in range(self.num - 1, 0, -1):
            self.tree[i] = self.segfunc(self.tree[2 * i], self.tree[2 * i + 1])

    def update(self, k, x):
        """
        k番目の値をxに更新
        k: index(0-index)
        x: update value
        """
        k += self.num
        self.tree[k] = x
        while k > 1:
            self.tree[k >> 1] = self.segfunc(self.tree[k], self.tree[k ^ 1])
            k >>= 1

    def query(self, l, r):
        """
        [l, r)のsegfuncしたものを得る
        l: index(0-index)
        r: index(0-index)
        """
        res = self.ide_ele

        l += self.num
        r += self.num
        while l < r:
            if l & 1:
                res = self.segfunc(res, self.tree[l])
                l += 1
            if r & 1:
                res = self.segfunc(res, self.tree[r - 1])
            l >>= 1
            r >>= 1
        return res


st = SegTree([0]*N, segfunc, ide_ele)
for _ in range(N):
    a = int(input())-1
    x = st.query(max(a-K, 0), min(a+K+1, N))
    st.update(a, x+1)

print(st.query(0, N))

### FIXED CODE ###

N, K = map(int, input().split())
 
lm = 300001
 
# N: 処理する区間の長さ
N0 = 2**(lm-1).bit_length()
INF = 0
data = [INF]*(2*N0)
# a_k の値を x に更新
def update(k, x):
    k += N0-1
    data[k] = x
    while k >= 0:
        k = (k - 1) // 2
        data[k] = max(data[2*k+1], data[2*k+2])
# 区間[l, r)の最小値
def query(l, r):
    L = l + N0; R = r + N0
    s = 0
    while L < R:
        if R & 1:
            R -= 1
            s = max(s, data[R-1])
 
        if L & 1:
            s = max(s, data[L-1])
            L += 1
        L >>= 1; R >>= 1
    return s
 
for _ in range(N):
    a = int(input())
    x = query(max(0, a-K), min(lm, a+K+1))
    update(a, x+1)
 
print(query(0, lm))
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限x
N = 10**6
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


X, Y = map(int, input().strip().split())

min_num = min(X,Y)
z = min_num//3

tX = z * 3
tY = z * 3
cA = z
cB = z

rx = X - tX
ry = Y - tY
if rx == 0 and ry == 0:
    raise Exception
    print(cmb(cA+cB, cA, mod))
    exit(0)

if rx != 0 and ry / rx == 2:
    cA += rx
elif ry != 0 and rx / ry == 2:
    cB += ry
else:
    print(0)
    exit(0)

print(cmb(cA+cB, cA, mod))
# 6.0


### FIXED CODE ###

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限x
N = 10**6
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


X, Y = map(int, input().strip().split())
if (X + Y) % 3 != 0:
    print(0)
    exit(0)

a = (2*X-Y)//3
b = (2*Y-X)//3

if a < 0 or b < 0:
    print(0)
    exit(0)

print(cmb(a+b,a, mod))
n,k = map(int,input().split())
a = [int(i) for i in input().split()]
ans = sum(a)
b = [0 for i in range(18)]
for j in range(18):
    for i in range(len(a)):
        if a[i]%2==1 : b[j]+=1
        a[i]//=2
c = 18
if k==0 : c = -1
else :
    while 2**(c)>k : c-=1
print(b)
while c>=0:
    if 2**(c)>k :
        c-=1
        continue;
    if b[c] < n-b[c]:
        k-=2**c
        ans -=b[c]*2**c
        ans += (n-b[c])*2**c
    c-=1
print(ans)


### FIXED CODE ###

n,k = map(int,input().split())
a = [int(i) for i in input().split()]
ans = sum(a)
b = [0 for i in range(41)]
for j in range(41):
    for i in range(len(a)):
        if a[i]%2==1 : b[j]+=1
        a[i]//=2
c = 40
if k==0 : c = -1
while c>=0:
    if 2**(c)>k :
        c-=1
        continue;
    if b[c] < n-b[c]:
        k-=2**c
        ans -=b[c]*2**c
        ans += (n-b[c])*2**c
    c-=1
print(ans)
#ABC157.B
A = list(map(int,input().split()))
N = int(input())
b = [int(input())for _ in range(N)]
for i in b:
    if i in A:
        A[A.index(i)]=0
if A[0]==0 and A[1]==0 and A[2]==0:
    print('Yes')
elif A[3]==0 and A[4]==0 and A[5]==0:
    print('Yes')
elif A[6]==0 and A[7]==0 and A[8]==0:
    print('Yes')

elif A[0]==0 and A[3]==0 and A[6]==0:
    print('Yes')
elif A[1]==0 and A[4]==0 and A[7]==0:
    print('Yes')
elif A[2]==0 and A[5]==0 and A[8]==0:
    print('Yes')

elif A[0]==0 and A[4]==0 and A[8]==0:
    print('Yes')
elif A[2]==0 and A[4]==0 and A[6]==0:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

#ABC157.B
A1 = list(map(int,input().split()))
A2 = list(map(int,input().split()))
A3 = list(map(int,input().split()))
N = int(input())
b = [int(input())for _ in range(N)]
if (A1[0] in b)and (A1[1]in b)and (A1[2] in b):
    print('Yes')
elif (A2[0]in b)and(A2[1] in b)and(A2[2]in b):
    print('Yes')
elif (A3[0]in b)and(A3[1]in b)and (A3[2]in b):
    print('Yes')
elif (A1[0]in b)and(A2[0]in b)and(A3[0]in b):
    print('Yes')
elif (A1[1]in b)and (A2[1]in b)and(A3[1]in b):
    print('Yes')
elif (A1[2] in b)and (A2[2]in b)and(A3[2]in b):
    print('Yes')
elif (A1[0]in b)and (A2[1]in b)and(A3[2]in b):
    print('Yes')
elif (A1[2]in b)and (A2[1]in b)and(A3[0]in b):
    print('Yes')
else:
    print('No')
n = input()
A = []
B = []
for i in range(n):
  a,b = map(int, input().split())
  A.append(a)
  B.append(b)
A.sort()
B.sort()
j = n//2
if n%2 == 0:
  print((B[j]+B[j+1])-(A[j]+A[j+1])+1)
else:
  print(B[j]-A[j]+1)

### FIXED CODE ###

n = int(input())
A = []
B = []
for i in range(n):
  a,b = list(map(int, input().split()))
  A.append(a)
  B.append(b)
A.sort()
B.sort()
j = n//2
if n%2 == 0:
  print((B[j]+B[j-1])-(A[j]+A[j-1])+1)
else:
  print(B[j]-A[j]+1)
N = int(input())
D, X = map(int, input().split())
A = []
for i in range(N):
    A.append(input())
    
B=0
for i in range(N):
    B += 1 + (D-1)//A[i]

    
Total = X + B

print(Total)



### FIXED CODE ###

N = int(input())
D, X = map(int, input().split())
A = []
for i in range(N):
    A.append(int(input()))
    
B=0
for i in range(N):
    B += 1 + (D-1)//A[i]

    
Total = X + B

print(Total)
n,m = map(int,input().split())
height = list(map(int,input().split()))
lower_list = []
for i in range(m):
    r = list(map(int,input().split()))
    if height[r[0]-1] > height[r[1]-1]:
        lower_list.append(r[1])
    elif:
        lower_list.append(r[0],r[1])
    else:
        lower_list.append(r[0])
count = len(set(lower_list))
print(n-count)

### FIXED CODE ###

n,m = map(int,input().split())
height = list(map(int,input().split()))
lower_list = []
for i in range(m):
    r = list(map(int,input().split()))
    if height[r[0]-1] > height[r[1]-1]:
        lower_list.append(r[1])
    elif height[r[0]-1] == height[r[1]-1]:
        lower_list.append(r[0])
        lower_list.append(r[1])
    else:
        lower_list.append(r[0])
count = len(set(lower_list))
print(n-count)
N=int(input())
c=list(map(int, input().split()))
k = 1
count = 0
while True:
  for i in range(N):
    k = k*c[N]
  c_1 = (c % (2**N))
  if (c_1 == 0):
    for j in range(N):
      count += 1
      c[j] = c[j]/2
  else:
    break
print(count)
  

### FIXED CODE ###

n = int(input())
c = list(map(int, input().split()))
k = 1
count = 0
while True:
  q = 0
  for i in range(n):
    if (c[i]%2 ==1):
      q += 1
  if (q > 0):
    break
  else:
    for j in range(n):
      c[j] = c[j] / 2
    count += 1
print(count)
A = list(str(input()))
B = list(str(input()))
C = list(str(input()))
a_len = len(A)
b_len = len(B)
c_len = len(C)
next = "A"

while a_len>=0 and b_len>=0 and c_len>=0:
    if next=="A":
        next = A[0]
        del A[0]
        a_len -= 1
    elif next=="B":
        next = B[0]
        del B[0]
        b_len -= 1
    else:
        next = C[0]
        del C[0]
        c_len -= 1
print(next.upper())

### FIXED CODE ###

A = list(str(input()))
B = list(str(input()))
C = list(str(input()))
a_len = len(A)
b_len = len(B)
c_len = len(C)
next = "a"

while a_len>=0 and b_len>=0 and c_len>=0:
    if next=="a":
        if a_len>=1:
            next = A[0]
            del A[0]
        a_len -= 1
    elif next=="b":
        if b_len>=1:
            next = B[0]
            del B[0]
        b_len -= 1
    else:
        if c_len>=1:
            next = C[0]
            del C[0]
        c_len -= 1
print(next.upper())
[n,t]=list(map(int,input().split()))
ntlist=[list(map(int,input().split())) for _ in range(n)]

anslist=[nt[0] for nt in ntlist if nt[1]<=t]
if ans==[]:
  print("TLE")
else:
  print(min(ans))

### FIXED CODE ###

[n,t]=list(map(int,input().split()))
ntlist=[list(map(int,input().split())) for _ in range(n)]
 
anslist=[nt[0] for nt in ntlist if nt[1]<=t]
if anslist==[]:
  print("TLE")
else:
  print(min(anslist))
W, H ,x, y = map(int, input().split())
if H > W:
  if x == W/2:
    can = 0
  else:
    can = 1
elif H == W:
  can = 1
else:
  if y == H/2:
    can = 0
  else:
    can = 1
  
print(float(W*H/2) + ' '  + can)

### FIXED CODE ###

W, H ,x, y = map(int, input().split())
if W == H:
  if x == W/2 and y == H/2:
    can = 1
  else:
    can = 0
else:
  if x == W/2 or y == H/2:
    if x == W/2 and y == H/2:
      can = 1
    else:
      can = 0
  else:
    if y == (H/W)*x or y == (-H/W)*x:
      can = 0
    else:
      can = 1
 
print('{:.9f}'.format(W*H/2), can)
n,k=[int(x) for x in input().split()]
a=[int(x) for x in input().split()]
 
sol=[]
for i in range(n-1):
  sol.append(a[i+1]-a[i])
sol.append(a[0]-a[n-1]+k)
 
sorted(sol)
#unwanted segment of max length removed while printing
print(sum(sol[0:n-1]))

### FIXED CODE ###

k,n=[int(x) for x in input().split()]
a=[int(x) for x in input().split()]
 
sol=[]
for i in range(n-1):
  sol.append(a[i+1]-a[i])
sol.append(a[0]-a[n-1]+k)
 
sol.sort()
print(sum(sol[:n-1]))
while True:
    n = int(raw_input())
    if n == 0:
        break
    m,x,d = int(raw_input())-1,int(raw_input())-1,int(raw_input())
    amida = []
    for i in range(d):
        amida[i] = "0" + raw_input() + "0"
    rroot = []
    for i in range(d-1,-1,-1):
        if amida[i][x-1] == "1":
            x -= 1
        elif amida[i][x] == "1":
                x += 1
        rroot.append(x)
    if m == x:
        print 0
    else:
        root = []
        for i in range(d):
            if amida[i][m-1] == "1":
                m -= 1
            elif amida[i][m] == "1":
                m += 1
            root.append(m)
        rroot.reverse()
        for i in range(d):
            if abs(root[i]-rroot[i]) == 1:
                p = min(root[i],rroot[i])
                if int(amida[i][p-1]) + int(amida[i][p+1]) == 0:
                    print i+1, p+1
                    break
            if i == d-1:
                print 1

### FIXED CODE ###

while True:
    n = int(raw_input())
    if n == 0:
        break
    m,x,d = int(raw_input()),int(raw_input()),int(raw_input())
    amida = ["" for i in range(d)]
    for i in range(d):
        amida[i] = "0" + raw_input() + "0"
    rroot = []
    for i in range(d-1,-1,-1):
        if amida[i][x-1] == "1": x -= 1
        elif amida[i][x] == "1" : x += 1
        rroot.append(x)

    if m == x: print 0
    else:
        root = []
        for i in range(d):
            if amida[i][m-1] == "1": m -= 1
            elif amida[i][m] == "1" : m += 1
            root.append(m)
        rroot.reverse()
        for i in range(d):
            if abs(root[i]-rroot[i]) == 1:
                p = min(root[i],rroot[i])
                if int(amida[i][p-1]) + int(amida[i][p+1]) == 0:
                    print i+1, p
                    break
            if i == d-1: print 1
import sys


def count(i, x):
    counter[i] += x
    for e in es[i]:
        count(e, x)


if __name__ == "__main__":
    sys.setrecursionlimit(2*(10**5))
    N, Q = map(int, input().split())
    es = [[] for _ in range(N+1)]
    for _ in range(N-1):
        a, b = map(int, input().split())
        es[a].append(b)
    counter = [0 for _ in range(N+1)]
    for _ in range(Q):
        p, x = map(int, input().split())
        count(p, x)
    for i in range(1, N+1):
        if i == N:
            print(counter[i], end="\n")
        else:
            print(counter[i], end=" ")


### FIXED CODE ###

import sys


def count(i, r, value):
    value += rc[i]
    counter[i] = value
    for e in es[i]:
        if e != r:
            count(e, i, value)


if __name__ == "__main__":
    sys.setrecursionlimit(10**6)
    input = sys.stdin.readline
    N, Q = map(int, input().split())
    es = [[] for _ in range(N)]
    for _ in range(N-1):
        a, b = map(int, input().split())
        es[a-1].append(b-1)
        es[b-1].append(a-1)
    counter = [0]*N
    rc = [0]*N
    for _ in range(Q):
        p, x = map(int, input().split())
        rc[p-1] += x
    count(0, -1, 0)
    print(*counter)
as, bs, cs = input().split(" ")

a = int(as)
b = int(bs)
c = int(cs)

if a < b < c:
  print("Yes")
else
  print("No")

### FIXED CODE ###


ass, bss, css = input().split(" ")

a = int(ass)
b = int(bss)
c = int(css)

if a < b < c:
  print("Yes")
else:
  print("No")