Harryxun/stf_run huggingface dataset:
N=int(input())
A=[int(x) for x in input().split()]
ans=0
for i in range(N):
  for j in range(i+1,N):
    ans=max(ans,abs(A[i]-A[j])
print(ans)

### FIXED CODE ###

N=int(input())
A=[int(x) for x in input().split()]
ans=0
for i in range(N):
  for j in range(i+1,N):
    ans=max(ans,abs(A[i]-A[j]))
print(ans)
n=int(input())
a=list(map(int,input().split()))
print(2*n-1)
if abs(a)>max(a):
    b=a.index(min(a))
    for i in range(n):
        print(b+1,i+1)
    for j in range(n-1,0,-1):
        print(j+1,j)
else:
    b=a.index(max(a))
    for i in range(n):
        print(b+1,i)
    for j in range(n-1):
        print(j+1,j+2)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
print(2*n-1)
if abs(max(a))>=abs(min(a)):
    b=a.index(max(a))
    for i in range(n):
        print(b+1,i+1)
    for j in range(n-1):
        print(j+1,j+2)
    
else:
    b=a.index(min(a))
    for i in range(n):
        print(b+1,i+1)
    for j in range(n-1,0,-1):
        print(j+1,j)
import math
a,b = map(int,input().split())

def lcm(a,b):
    return (a*b) // math.gcd(a,b)
  
print(lcm(a,b))

### FIXED CODE ###

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

n = max(a,b)
m = min(a,b)

def gcd(n,m):
    l = n % m
    if l == 0:
        return m
    return gcd(m,l)

def lcm(n,m):
    return (n*m) // gcd(n,m)
    
print(lcm(n,m))
mod=10**9+7
n=int(input())
a=list(map(int,input().split()))
a.sort()
g=a[0]
d=defaultdict(int)
for i in a:
    g=math.gcd(g,i)
    d[i]+=1
if g>1:
    print("not coprime")
p=[0]*(a[-1]+1)
ch=0
for i in range (2,a[-1]+1):
    if p[i]==1:
        continue
    p[i]=1
    ans=0
    for j in range (i,a[-1]+1,i):
        ans+=d[j]
    if ans>1:
        ch=1
        break
if ch==1:
    print("setwise coprime")
else:
    print("pairwise coprime")

### FIXED CODE ###

import math
mod=10**9+7
n=int(input())
a=list(map(int,input().split()))
m=max(a)+1
g=a[0]
d=dict()
for i in a:
    g=math.gcd(g,i)
    if i in d:
        d[i]+=1
    else:
        d[i]=1
if g>1:
    print("not coprime")
else:
    p=[0]*(m)
    ch=0
    for i in range (2,m):
        if p[i]==1:
            continue
        p[i]=1
        ans=0
        for j in range (i,m,i):
            if j in d:
                ans+=d[j]
        if ans>1:
            ch=1
            break
    if ch==1:
        print("setwise coprime")
    else:
        print("pairwise coprime")
while 1:
    str = raw_input()
    if str=="0": break;
    resul = 0
    for ch in str:
        resul += int ch
    print resul

### FIXED CODE ###

while 1:
    str = raw_input()
    if str=="0": break;
    resul = 0
    for ch in str:
        resul += int(ch)
    print resul
import functools
import math

values = [290021904, 927964716, 826824516, 817140688]
gcd = functools.reduce(math.gcd, values)
print(gcd)

### FIXED CODE ###

n = input()

if(n == 'A'):
    print('T')
elif(n == 'T'):
    print('A')
elif(n == 'C'):
    print("G")
elif(n == 'G'):
    print('C')
n = int(input())
a = list(map(int, input().split()))
a2 = sorted(a)
a3 = [ a2[i + 1] for i in a2 ]
print(a3)

### FIXED CODE ###

import numpy as np
n = int(input())
a = list(map(int, input().split()))
a2 = np.argsort(a) + 1
a3 = map(str, a2) 
mojiretsu = ' '.join(a3)

print(mojiretsu)
H, W=map(int,input().strip().split(' '))

V=10
E=45
inf=10**9

def w_f():
    cost=[]
    for i in range(10):
        cost.append(list(map(int,input().strip().split(' '))))

    for i in range(V):
        for j in range(V):
            for k in range(V):
                cost[i][j]=min(cost[i][j],cost[i][k]+cost[k][j])
    return cost


d=w_f()

ans=0
for i in range(H):
    a=list(map(int,input().strip().split(' ')))
    for j in a:
        if j!==-1:
            ans+=d[j][1]

print(ans)



### FIXED CODE ###

H, W=map(int,input().strip().split(' '))

cost=[]
for i in range(10):
    cost.append(list(map(int,input().strip().split(' '))))

for k in range(10):
    for i in range(10):
        for j in range(10):
            cost[i][j]=min(cost[i][j],cost[i][k]+cost[k][j])
ans=0
for i in range(H):
    a=list(map(int,input().strip().split(' ')))
    for j in a:
        if j!=-1:
            ans+=cost[j][1]
print(ans)
n,k=map(int,input().split())
A=[]
for i in range(n):
    a=list(map(int,input().split()))
    A.append(a)
S=sorted(A,key=lambda,x:x[0])
i=0
while k>0:
    k-=a[i][1]
    i+=1
print(a[i][0])

### FIXED CODE ###

n,k=map(int,input().split())
A=[]
for i in range(n):
    a=list(map(int,input().split()))
    A.append(a)
S=sorted(A,key=lambda x:x[0])
i=0

while i<n:
    a=S[i][1]
    if k<=a:
        print(S[i][0])
        exit()
    else:
        k-=S[i][1]
        i+=1
print(int(input()+1)//2)

### FIXED CODE ###

print((int(input())+1)//2)
L = [int(i) for i in input().split()]

min_root = []
for i in L:
    for j in L:
        if i != j:
            min_root.append(i+j)
        else:
            continue

print(min(min_root))


### FIXED CODE ###

L = [int(i) for i in input().split()]

min_root = []
for i in L:
    for j in L:
        if i != j:
            min_root.append(i+j)
        else:
            continue
            
if len(min_root) > 0:
    print(min(min_root))
else:
    print(L[0]+L[1])
from math import floor

def solve(n, A):
    A.sort()
    b = A[n // 2 + 1]
    return sum(abs(a - (b + i + 1)) for i, a in enumerate(A))

_n = int(input())
_A = list(map(int, input().split()))
print(solve(_n, _A))


### FIXED CODE ###

from math import floor

def solve(n, A):
    B = sorted([a - (i + 1) for i, a in enumerate(A)])
    b = B[n // 2]
    ret = sum(abs(a - (b + i + 1)) for i, a in enumerate(A))
    if n % 2 == 0:
        b = B[n // 2 + 1]
        tmp = sum(abs(a - (b + i + 1)) for i, a in enumerate(A))
        if tmp < ret:
            ret = tmp
    return ret

_n = int(input())
_A = list(map(int, input().split()))
print(solve(_n, _A))
n, k = map(int, input().split())
td = list(sorted([tuple(map(int, input().split())) for _ in range(n)], key=lambda td: -td[1]))
td2 = []
eaten = set()
dup = 0
score = k * k
while len(eaten) + dup < k:
    if td[0][0] in eaten:
        td2.append(td.pop(0))
    else:
        diff = (k - dup) * (k - dup) - (k - dup - 1) * (k - dup - 1)
        if not td2 or td[0][1] >= td2[0][1] - diff:
            t, d = td.pop(0)
            score += d
            eaten.add(t)
        else:
            t, d = td2.pop(0)
            score += d - diff
            dup += 1

print(score)


### FIXED CODE ###

n, k = map(int, input().split())
td = list(sorted([tuple(map(int, input().split())) for _ in range(n)], key=lambda td: -td[1]))
td2 = []
eaten = set()
dup = 0
score = k * k
i = 0
j = 0
while len(eaten) + dup < k:
    if i < n and td[i][0] in eaten:
        td2.append(td[i])
        i += 1
    else:
        diff = (k - dup) * (k - dup) - (k - dup - 1) * (k - dup - 1)
        if i < n and (j >= len(td2) or td[i][1] >= td2[j][1] - diff):
            t, d = td[i]
            score += d
            eaten.add(t)
            i += 1
        else:
            t, d = td2[j]
            score += d - diff
            dup += 1
            j += 1
print(score)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
from copy import deepcopy
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7

h,w=MI()
data=[list(input().rstrip()) for i in range(h)]
#print(data)
deletes=[]
for i in range(h):
    count=0
    for j in range(w):
        if data[i][j]==".":
            count+=1
    if count==w:
        deletes.append(i)
for j in list(reversed(deletes)):
    del data[j]
#print(data)
h-=len(deletes)
data2=[[0 for i in range(h)] for j in range(w) ]
for i in range(w):
    for j in range(h):
        data2[i][j]=data[j][i]
#print(data2)
deletes2=[]
for i in range(w):
    count=0
    for j in range(h):
        if data2[i][j]==".":
            count+=1
    if count==h:
        deletes2.append(i)
for j in list(reversed(deletes2)):
    del data2[j]
w-=len(deletes2)
#print(data2)
data3=[[0 for i in range(h)] for j in range(w) ]
for i in range(h):
    for j in range(w):
        data3[i][j]=data2[j][i]
#print(data3)
for i in range(h):
    for j in range(w):
        print(data3[i][j],end="")
    print("")

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
from copy import deepcopy
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7

h,w=MI()
data=[list(input().rstrip()) for i in range(h)]
#print(data)
deletes=[]
for i in range(h):
    count=0
    for j in range(w):
        if data[i][j]==".":
            count+=1
    if count==w:
        deletes.append(i)
for j in list(reversed(deletes)):
    del data[j]
#print(data)
h-=len(deletes)
data2=[[0 for i in range(h)] for j in range(w) ]
for i in range(w):
    for j in range(h):
        data2[i][j]=data[j][i]
#print(data2)
deletes2=[]
for i in range(w):
    count=0
    for j in range(h):
        if data2[i][j]==".":
            count+=1
    if count==h:
        deletes2.append(i)
for j in list(reversed(deletes2)):
    del data2[j]
w-=len(deletes2)
#print(data2)
data3=[[0 for i in range(w)] for j in range(h)]
#print(h,w)
#print(data3)
for i in range(h):
    for j in range(w):
        data3[i][j]=data2[j][i]
#print(data3)
for i in range(h):
    for j in range(w):
        print(data3[i][j],end="")
    print("")
# -*- coding: utf-8 -*-

def main():
    input_char_list = list(raw_input("type 3 digits number using only 0 or 1: "))
    count = 0
    for char in input_char_list:
        if char == '1':
            count += 1
    print(count)

if __name__ == '__main__':
    main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
 
def main():
    input_char_list = list(input())
    count = 0
    for char in input_char_list:
        if char == '1':
            count += 1
    print(count)
 
if __name__ == '__main__':
    main()
import math
length,target = (int(n) for n in input().split(" "))
ball = [int(n) for n in input().split(" ")]
gcd = ball[0]
for i in range(1,length):
    gcd = math.gcd(gcd,ball[i])
if target % gcd == 0 and target <= max(ball):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")


### FIXED CODE ###

import fractions 
length,target = (int(n) for n in raw_input().split(" "))
ball = [int(n) for n in raw_input().split(" ")]
gcd = ball[0]
for i in range(1,length):
    gcd = fractions.gcd(gcd,ball[i])
if target % gcd == 0 and target <= max(ball):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
#
# abc071 c
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """6
3 1 2 4 2 1"""
        output = """2"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """4
1 2 3 4"""
        output = """0"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """10
3 3 3 3 4 4 4 5 5 5"""
        output = """20"""
        self.assertIO(input, output)


def resolve():
    N = int(input())
    A = list(map(int, input().split()))

    Num = [0] * N
    for a in A:
        Num[a-1] += 1

    l1 = l2 = 0
    print(l1*l2)


if __name__ == "__main__":
    # unittest.main()
    resolve()


### FIXED CODE ###

#
# abc071 c
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """6
3 1 2 4 2 1"""
        output = """2"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """4
1 2 3 4"""
        output = """0"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """10
3 3 3 3 4 4 4 5 5 5"""
        output = """20"""
        self.assertIO(input, output)


def resolve():
    N = int(input())
    A = list(map(int, input().split()))

    A.sort(reverse=True)
    l1 = l2 = 0
    for i in range(1, N):
        if l1 == 0:
            if A[i] == A[i-1]:
                l1 = A[i-1]
        else:
            if i < N-1 and A[i+1] == A[i]:
                l2 = A[i]
                break

    print(l1*l2)


if __name__ == "__main__":
    # unittest.main()
    resolve()
A,B,M = map(int,input().split())
A_li = list(map(int,input().split()))
B_li = list(map(int,input().split()))

inf = float("inf")
posibility = inf

for m in range(M):
    x,y,c=map(int,input().split())
    tmp_posibility=A_li[x-1]+B_li[y-1]-c
    posibility=min(posibility,tmp_posibility)
 

no_c = min(A_li)+min(B_li)
decition = min(posibility,no_c)

print(decition)

### FIXED CODE ###

S = input()
l = len(S)


judge=True
if l%2==0:
    for i in range(l//2):
        if not S[2*i:2*(i+1)]=="hi":
            judge=False
    if judge:
        print("Yes")
    else:
        print("No")
else:
    print("No")
import numpy as np
n,m=map(int,input().split())
if m==0:
    print(0)
    exit()
ans=[[] for i in range(n)]
for i in range(m):
    a,b=map(int,input().split())
    ans[a-1].append((b-1))
    ans[b-1].append((a-1))
v=[]
def dfs(now,visited=[]):
    global v
    if len(visited)==n:
        v.append([visited])
        return
    for j in ans[now]:
        for j not in visited:
            dfs(j,visited+[j])
dfs(0,[0])
print(len(v))

### FIXED CODE ###

import itertools
n,m=map(int,input().split())
e=[set() for _ in range(n+1)]
for _ in range(m):
    a,b=map(int,input().split())
    e[a].add(b)
    e[b].add(a)
count=0
for i in itertools.permutations(range(2,n+1)):
    if i[0] not in e[1]:
        continue
    f=True
    for j in range(n-2):
        if i[j+1] not in e[i[j]]:
            f=False
            break
    if f:
        count+=1
print(count)
import numpy as np

n = int(input())

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

a.sort()

temp = a[-1] / 2

if a[0] != 1:
    a = np.array(a)

    i = 0

    while i < len(a):
        b = a / a[i]

        a = a[(b != b.astype(int)) | (b == 1)]

        i += 1

        if a[i] > temp:
            break

    u, counts = np.unique(a, return_counts=True)

    print(sum(counts == 1))

elif (len(a) > 1) and (a[0] == a[1]):
    print(0)
else:
    print(1)

### FIXED CODE ###

n = int(input())

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

a.sort()

dp = [True] * (a[-1] + 1)

ans = 0

m = a[-1]

for i, x in enumerate(a[:-1]):
    if not a[i+1] == x and dp[x]:
        ans += 1
    for b in range(x, m + 1, x):
        dp[b] = False

if dp[a[-1]]:
    ans += 1

print(ans)
import math
r = int(input())
print(r ** 2 * math.pi, 2 * r * math.pi)

### FIXED CODE ###

import math
r = float(input())
area = r * r * math.pi
circum = 2 * r * math.pi
print("{:f} {:f}".format(area, circum))
N = int(input())
total = 0 
X = list( input().split())
for i in X: 
    total +=  (X[i] - N) * (X[i] - N)
print(total)
  

### FIXED CODE ###

N = int(input())
X = list(map(int, input().split()))
M = round(sum(X)/N)
ans = 0
for i in X:
    ans+=(i-M)**2
print(ans)
N = input()
H = list(map(int,input().split()))
count = 0
max = 0
for h in H:
  if max<=h:
    count++
    max=h
    
print(count)

### FIXED CODE ###

N = input()
H = list(map(int,input().split()))
count = 0
max = 0
for h in H:
  if max<=h:
    count+=1
    max=h
    
print(count)
# ABC085C

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

for i in range(n+1):
    for j in range(n-i+1):
        k = n - i - j
        if k >= 0:
            if y == i*10000 + j*5000 + k*1000:
                print(i, j, k)
                return
print(-1, -1, -1)


### FIXED CODE ###

def f(n, y):
    for i in range(n+1):
        for j in range(n-i+1):
            k = n - i - j
            if k >= 0:
                if y == i*10000 + j*5000 + k*1000:
                    print(i, j, k)
                    return
    print(-1, -1, -1)

n, y = map(int, input().split())
f(n, y)
N = int(input())
A = list(map(int, input().split()))
B = sorted(set(A))
if N % 3 == 0:
    if len(B) == 1 and B[0] == 0:
        print('Yes')
        exit()
    if len(B) == 2 and A.count(0) == N // 3 and A.count(B[1]) == 2 * N // 3:
        if B[0] ^ B[1] ^ B[2] == 0:
            print('Yes')
            exit()
    if len(B) == 3 and A.count(B[0]) == A.count(B[1]) == A.count(B[2]):
        print('Yes')
        exit()

print('No')


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
B = sorted(set(A))

if len(B) == 1 and B[0] == 0:
    print('Yes')
    exit()

if N % 3 == 0:
    if len(B) == 2 and A.count(0) == N // 3:
        print('Yes')
        exit()
    if len(B) == 3 and A.count(B[0]) == A.count(B[1]) == A.count(B[2]):
        if B[0] ^ B[1] ^ B[2] == 0:
            print('Yes')
            exit()

print('No')
k = int(input())
a,b = map(int, input().split)

aa = a % k
bb = b % k

if(b - a > k):
    print('OK')
if(aa > bb):
    print('OK')
if(aa == 0):
    print('OK')
else:
    print('NG')


### FIXED CODE ###

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

aa = a % k
bb = b % k

if(b - a >= k):
    print('OK')
elif(aa > bb):
    print('OK')
elif(aa == 0):
    print('OK')
else:
    print('NG')
n=int(input())
l=sorted(list(map(int,input().split())),reverse=True)
print(sum(l[1::2])

### FIXED CODE ###

n=int(input())
l=sorted(list(map(int,input().split())),reverse=True)
print(sum(l[1::2]))
K,X = map(int,input().split())

l = max(X-K+1,-1000000)
r = min(X+K-1,1000000)

ans = []

for i in range(l,r+1):
    ans.append(str(i))

ans = " ".join(ans)

print(ans)

### FIXED CODE ###

N = int(input())

ans = 0
d = {}

for i in range(N):
    txt = "".join(sorted(input()))
    d.setdefault(txt,0)
    
    ans += d[txt]
    d[txt] += 1
    
print(ans)
from collections import Counter
from functools import reduce
 
def counter(list_1):
	return ((reduce(lambda a,b:a*b,map(lambda x:x+1,list_1))-1)%(10**9+7))
  
N=input()
S=input()
answer=counter(Counter(S))
print(answer)

### FIXED CODE ###

from collections import Counter
from functools import reduce
 
def counter(list_1):
	return ((reduce(lambda a,b:a*b,map(lambda x:x+1,list_1))-1)%(10**9+7))
  
N=input()
S=input()
answer=counter(Counter(S).values())
print(answer)
print(int(input)^1)

### FIXED CODE ###

print(int(input())^1)
a, b = map(int,input().split())
print(max[a+b,a-b,a*b])

### FIXED CODE ###

a, b = map(int,input().split())
x=a+b
y=a-b
z=a*b
list=[x,y,z]
print(max(list))
input()
S = input()
K = int(input())

c = S[K]

print("".join([v if v == c else "*" for v in S]))


### FIXED CODE ###

input()
S = input()
K = int(input())

c = S[K-1]

print("".join([v if v == c else "*" for v in S]))
a,b = input().split()
a,b = int(a),int(b)
print(max(a-2*b,0))

### FIXED CODE ###

a,b = input().split()
a,b = int(a),int(b)
print(max(a-2*b,0))
N,M=map(int,input90.split())
print(max(0,N-2*M))

### FIXED CODE ###

N,M=map(int, input().split())
print(max(0,N-2*M))
K,S=map(int,input().split())
cnt=0
for X in range(K+1):
  for Y in range(K+1):
    if 0<=S-X-Y and S-X-Y <= k:
      cnt+=1
print(cnt)

### FIXED CODE ###

K,S=map(int,input().split())
cnt=0
for X in range(K+1):
  for Y in range(K+1):
    if 0<=S-X-Y and S-X-Y<=K:
      cnt+=1
print(cnt)
n = (int(input()))
a = (int(input()))
if n%500<= a:
    plint('Yes')
else:
    print('No')

### FIXED CODE ###

n = int(input())
a = int(input())
if n%500<=a:
    print("Yes")
else:
    print("No")
a = input()

for i in range(0,3):
  if a[i] == a[i+1]:
    print("Bad")
	return

print("Good")

### FIXED CODE ###

a = input()
flag = False

for i in range(0, 3):
    if a[i] == a[i+1]:
        print("Bad")
        flag = True
        break

if not flag:
    print("Good")
def noboru(i, a2, a1):
    if (i == 1):
        return a1
    elif (i == 2):
        return a2
    else:
        return noboru(i-1, a2+a1, a2)


def func(N, M, a):
    ans = 1
    for i in range(M):
        if (i==0):
            if (a[i] == 1):
                ans *= 1
            else:
                ans *= noboru(a[i] -1, 2, 1)
        elif(a[i] == a[i-1] + 1):
            return 0
        elif(a[i] == a[i-1] + 2):
            ans *= 1
        else:    
            ans *= noboru(a[i] - a[i-1] -2, 2, 1)
    ans *= noboru(N - a[M-1] -1, 2, 1)
    return ans

N, M = map(int, input().split(" "))
a = [int(input()) for _ in range(M)]
print(func(N, M, a) % 1000000007)

### FIXED CODE ###

CONST = 1000000007

def noboru(n):
    a1 = 1
    a2 = 2
    ans = 0
    if (n == 0 or n == 1): return a1
    elif (n == 2): return a2
    else:
        for i in range(1, n-1):
            ans = a2 + a1
            a1 = a2
            a2 = ans
        return a2

def func(N, M, a):
    ans = 1
    pos = 0
    for i in range(M):
        if (pos == a[i]):
            return 0
        else:
            ans = (ans * noboru(a[i] - pos - 1)) % CONST
            pos = a[i] + 1
    ans = (ans * noboru(N - pos)) % CONST
    return ans

N, M = map(int, input().split(" "))
a = [int(input()) for _ in range(M)]
print(func(N, M, a))
import math

a,b,c,d = map(int,input().split())
cd = math.gcd(c, d)
lcm(cd) = c*d//cd
ans = 0
for i in range(a,b+1):
  if i % lcm(cd) != 0:
    ans += 1
print(ans)






### FIXED CODE ###

A,B,C,D = map(int,input().split())

def gcd(a,b):
  while b:
    a,b = b,a%b
  return a

def F(N,C,D):
  x = N
  x -= N//C
  x -= N//D
  lcm = C*D//gcd(C,D)
  x += N//lcm
  return x

answer = F(B,C,D) - F(A-1,C,D)
print(answer)
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import decimal

def dfs(val,i,x):
    if val == x:
        return True
    if val > x or i > len(cost):
        return
    if dfs(val+cost[i],i+1,x):
        return True
    if dfs(val,i+1,x):
        return True
    return False

if __name__ == "__main__":
    x = int(input())
    cost = [100,101,102,103,104,105]
    a = dfs(0,0,x)
    if a == False:
        print(0)
    else:
        print(1)

### FIXED CODE ###

import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import decimal



if __name__ == "__main__":
    x = int(input())
    dp = [0]*101010
    dp[0] = 1
    for i in range(100,101010):
        for j in range(100,106):
            if dp[i-j]:
                dp[i] = 1
    print(dp[x])
N,M = map(int,input().split())
A = list(map(int,input().split()))
counter = 0
for i in range(M):
    counter += A[i]
    
if N - conter>=0:
    print(N-counter)
else:
    print("-1")

### FIXED CODE ###

N,M = map(int,input().split())
A = list(map(int,input().split()))
counter = 0
for i in range(M):
    counter += A[i]
    
if N - counter>=0:
    print(N-counter)
else:
    print(-1)