Harryxun/stf_run huggingface dataset:
def main():
    import sys
    n = int(input())
    a = list(map(int, input().split()))
    color = [0] * 8
    sub_color = 0
    count = 0
    for score in a
        if score <= 0:
            continue
        for i in range(8):
            if i*400 < score <= 399+(i*400):
                color[i] += 1
        if score >= 3200:
            sub_color += 1
    for j in color:
        if j != 0:
            count += 1
    if count + sub_color >= 8:
        print(count, 8, sep=" ")
    else:
        print(count, count+sub_color, sep=" ")

if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    n = int(input())
    a = list(map(int, input().split()))
    color = [False] * 8
    sub_color = 0
    for score in a:
        for i in range(8):
            if i*400 <= score <= 399+(i*400):
                color[i] = True
        if score >= 3200:
            sub_color += 1
    cnt = len([x for x in color if x])
    if cnt == 0:
        print(1, sub_color, sep=" ")
    else:
        print(cnt, cnt+sub_color, sep=" ")

if __name__ == "__main__":
    main()
def main():
    s = [int(char) for char in input()]
    l = len(s)
    k = int(input())

    tmp = 0
    nonzero = []
    for number in s:
        if number > 0:
            tmp += 1
        nonzero.append(tmp)
    nonzero.append(0)  # let nonzero[-1] be 0

    def binomial(n, k):
        if n < k or n < 0 or k < 0:
            raise ValueError
        if k == 0:
            return 1
        if k == 1:
            return n
        if k == 2:
            return n * (n-1) // 2
        if k == 3:
            return n * (n-1) * (n-2) // 6
        raise ValueError

    def dp(i, _cache={-1: 0}):
        if i in _cache:
            return _cache[i]
        if nonzero[i-1] > k or s[i] == 0:
            result = dp(i-1)
            _cache[i] = result
            return result
        if nonzero[i-1] == k:
            result = dp(i-1) + 1
            _cache[i] = result
            return result
        result = (
            dp(i-1) +
            (s[i] - 1) * binomial(l - 1 - i, k - nonzero[i-1] - 1) *
            9 ** (k - nonzero[i-1] - 1) +
            binomial(l - 1 - i, k - nonzero[i-1]) *
            9 ** (k - nonzero[i-1])
        )
        _cache[i] = result
        return result
    
    print(dp(l-1) + (nonzero[l-1] == k))


main()


### FIXED CODE ###

def main():
    s = [int(char) for char in input()]
    l = len(s)
    k = int(input())

    tmp = 0
    nonzero = []
    for number in s:
        if number > 0:
            tmp += 1
        nonzero.append(tmp)
    nonzero.append(0)  # let nonzero[-1] be 0

    def binomial(n, k):
        if n < k or n < 0 or k < 0:
            return 0
        if k == 0:
            return 1
        if k == 1:
            return n
        if k == 2:
            return n * (n-1) // 2
        if k == 3:
            return n * (n-1) * (n-2) // 6
        raise ValueError

    def dp(i, _cache={-1: 0}):
        if i in _cache:
            return _cache[i]
        if nonzero[i-1] > k or s[i] == 0:
            result = dp(i-1)
            _cache[i] = result
            return result
        if nonzero[i-1] == k:
            result = dp(i-1) + 1
            _cache[i] = result
            return result
        result = (
            dp(i-1) +
            (s[i] - 1) * binomial(l - 1 - i, k - nonzero[i-1] - 1) *
            9 ** (k - nonzero[i-1] - 1) +
            binomial(l - 1 - i, k - nonzero[i-1]) *
            9 ** (k - nonzero[i-1])
        )
        _cache[i] = result
        return result
    
    print(dp(l-1) + (nonzero[l-1] == k))


main()
a=input()
while a!="0 ? 0":
    print(int(eval(a)))
    a=input()


### FIXED CODE ###

while 1:
  s=input()
  if s.split()[1]=="?":exit()
  print(int(eval(s)))
import math

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

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

#####################################


#1:43
h,w = list(map(int, input().split()))
queue=[]
mp=[[-1 for i in range(h)]for j in range(w)]
for i in range(h):
    temp = input()
    for j in range(len(temp)):
        if(temp[j]=='#'):
            queue.append([j,i,0])
            mp[j][i]=0
            
nowq = 0
while(True):
    x,y,times = queue[nowq]
    if(mp[min(x+1,w-1)][y]==-1):
        mp[min(x+1,w-1)][y]=times+1
        queue.append([x+1,y,times+1])
    if(mp[max(x-1,0)][y]==-1):
        mp[max(x-1,0)][y]=times+1
        queue.append([x-1,y,times+1])
    if(mp[x][min(y+1,h-1)]==-1):
        mp[x][min(y+1,h-1)]=times+1
        queue.append([x,y+1,times+1])
    if(mp[x][max(y-1,0)]==-1):
        mp[x][max(y-1,0)]=times+1
        queue.append([x,y-1,times+1])
    nowq+=1
    if(len(queue)==nowq):
        break
ans=0
for i in range(h):
    ans=max(ans,max(mp[i]))
print(ans)

### FIXED CODE ###

import math

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

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

#####################################


#1:43
h,w = list(map(int, input().split()))
queue=[]
mp=[[-1 for i in range(h)]for j in range(w)]
for i in range(h):
    temp = input()
    for j in range(len(temp)):
        if(temp[j]=='#'):
            queue.append([j,i,0])
            mp[j][i]=0
            
nowq = 0
while(True):
    x,y,times = queue[nowq]
    if(mp[min(x+1,w-1)][y]==-1):
        mp[min(x+1,w-1)][y]=times+1
        queue.append([x+1,y,times+1])
    if(mp[max(x-1,0)][y]==-1):
        mp[max(x-1,0)][y]=times+1
        queue.append([x-1,y,times+1])
    if(mp[x][min(y+1,h-1)]==-1):
        mp[x][min(y+1,h-1)]=times+1
        queue.append([x,y+1,times+1])
    if(mp[x][max(y-1,0)]==-1):
        mp[x][max(y-1,0)]=times+1
        queue.append([x,y-1,times+1])
    nowq+=1
    if(len(queue)==nowq):
        break
ans=0
for i in range(w):
    ans=max(ans,max(mp[i]))
print(ans)
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
X = 0
for i in range(N):
    if(V[i]-C[i] > 0):
        X += V[i] - C[i]
print(X)

### FIXED CODE ###

A,B,T=map(int, input().split())
t_max = int((T+0.5)/A)
print(t_max*B)
import sys

S = input()

while S:
    prefix = S[0:5]
    if prefix == 'dream':
        if S[5:7] == 'er':
            if len(S) > 8 and S[7] == 'a':
                S = S[5:]
            else:
                S = S[7:]
        else:
            S = S[5:]
    elif prefix == 'erase':
        if S[5] == 'r':
            S = S[6:]
        else:
            S = S[5:]
    else:
        print('NO')
        sys.exit(0)
    # print(S)
print('YES')


### FIXED CODE ###

import sys

S = input()

while S:
    prefix = S[0:5]
    if prefix == 'dream':
        if S[5:7] == 'er':
            if len(S) >= 8 and S[7] == 'a':
                S = S[5:]
            else:
                S = S[7:]
        else:
            S = S[5:]
    elif prefix == 'erase':
        if len(S) >= 6 and S[5] == 'r':
            S = S[6:]
        else:
            S = S[5:]
    else:
        print('NO')
        sys.exit(0)
    # print(S)
print('YES')
A, B, C, X [int(inpit()) for i in range(4)]
print(sum(500 * a + 100 *b + 50 *c == X) for a in range(A+1) for b in range(B + 1) for c in range(C + 1)))


### FIXED CODE ###

A, B, C, X = [int(input()) for i in range(4)]
print(sum(500 * a + 100 * b + 50 * c == X for a in range(A+1) for b in range(B + 1) for c in range(C + 1)))
# your code goes here
def gcd(a,b):
    if b>a:
        t=b
        b=a
        a=t
    while b>0:
        r=a%b
        a=b
        b=r
    return a
N=int(input())
T=[int(input()) for i in range(N)]
g=gcd(T[0],T[1])
i=2
while i <N:
    g=gcd(T[i],g)
M=g
for i in range(N):
    M*=T[i]//g
print(M)

### FIXED CODE ###

# your code goes here
def gcd(a,b):
    if b>a:
        t=b
        b=a
        a=t
    a1=a
    b1=b
    while b1>0:
        r=a1%b1
        a1=b1
        b1=r
    a//=a1
    a*=b
    return a
N=int(input())
T=[int(input()) for i in range(N)]
if N==1:
    print (T[0])
else:
    m=gcd(T[0],T[1])
    i=2
    while i <N:
        m=gcd(m,T[i])
        i+=1
    print(m)
a,b = map(int,input())
print((a+b)//2)

### FIXED CODE ###

a,b = map(int,input().split())
print((a+b)//2)
import sys
input = sys.stdin.readline

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y

def modinv(a, m):
    g, x, y = egcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m

def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

X, Y = [int(x) for x in input().strip().split()]
p = (X, 2 * X)
n1 = X
n2 = 0
f = True
while p != (X, Y):
    n1 -= 2
    n2 += 1
    p = (n1 + 2 * n2, 2 * n1 + n2)
    if p[1] <= 0:
      	f = False
        break
if f:
    print(combination(n1 + n2, n1) % (10 ** 9 + 7))
else:
    print(0)

### FIXED CODE ###

import sys
input = sys.stdin.readline

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y

def modinv(a, m):
    g, x, y = egcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m

def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

X, Y = [int(x) for x in input().strip().split()]
p = (X, 2 * X)
n1 = X
n2 = 0
f = True
while p != (X, Y):
    n1 -= 2
    n2 += 1
    p = (n1 + 2 * n2, 2 * n1 + n2)
    if p[1] <= 0:
        f = False
        break

if n1 < 0 or n2 < 0:
    print(0)
else:
    print(combination(n1 + n2, n1) % (10 ** 9 + 7))
sn,sk,sq = input().split(" ")
n = int(sn)
k = int(sk)
q = int(sq)

l = [k for i in range(n)]

m =[0 for i in range(n)]

for i in range(q):
  sa = input()
  s = int(sa)
  m[s-1] += 1

for i in range(n):
  l[i] = l[i] - (q - m[i])
  
  if l[i] > 0:
    print("Yes")
  
  else:

### FIXED CODE ###

sn,sk,sq = input().split(" ")
n = int(sn)
k = int(sk)
q = int(sq)

l = [k for i in range(n)]

m =[0 for i in range(n)]

for i in range(q):
  sa = input()
  s = int(sa)
  m[s-1] += 1

for i in range(n):
  l[i] = l[i] - (q - m[i])
  
  if l[i] > 0:
    print("Yes")
  
  else:
     print("No")
N = 10000 - int(input())
ans = [str(x) for x in list(str(N))]
print(ans[-3]+ans[-2]+ans[-1])

### FIXED CODE ###

N = int(input())
if N % 1000 == 0:
    print(0)
else:
    print(1000 - (N % 1000))
N, A, B = map(int, input().split())
L = list(map(int, input().split()))

num = [0 for x in range(N)]
total = [0 for x in range(N)]

for i, v in enumerate(L):
    for j in reversed(range(1, i + 1)):
        new_v = total[j - 1] + v
        if(new_v > total[j]):
            total[j] = new_v
            num[j] = num[j - 1]
        elif(new_v == total[j]):
            num[j] = num[j] + num[j - 1]

    if(v > total[0]):
        total[0] = v
        num[0] = 1
    elif(v == total[0]):
        num[0] = num[0] + 1

print(total)
total = [x / (i + 1) for i, x in enumerate(total)]
total = total[(A - 1):B]
num = num[(A - 1):B]

maxV = max(total)
maxNum = sum([j for i, j in zip(total, num) if i == maxV])
print(maxV)
print(maxNum)

### FIXED CODE ###

if __name__ == '__main__':
    h1 = input()
    a, b = h1.split()
    print((int(a) + int(b)) % 24)
AB = list(map(str,input().split()))
if AB[1] == "+"
    print(int(AB[0])+int(AB[2]))
else:
    print(int(AB[0])-int(AB[2]))

### FIXED CODE ###

AB = list(map(str,input().split()))
if AB[1] == "+":
    print(int(AB[0])+int(AB[2]))
else:
    print(int(AB[0])-int(AB[2]))
total_cost = 0

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

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

AB_list.sort()

for i in range(N):
    if AB_list[i][1]<M:
        M = M - AB_list[i][1]
        total_cost =  total_cost + AB_list[i][0] * AB_list[i][1]
    else:
        total_cost = total_cost + M * AB_list[i][0]
        break
print(total_cost)


### FIXED CODE ###


H, W = map(int, input().split())
h, w = map(int, input().split())

print((H-h)*(W-w))
N = int(input())
N_sqrt = int(N**(1/2))
for i in range(1,N_sqrt):
    if N%i == 0:
        num = i
ans = num+N/num-2
print(ans)


### FIXED CODE ###

N = int(input())
N_sqrt = int(N**(1/2))
for i in range(1,N_sqrt+1):
    if N%i == 0:
        num = i
ans = num+N//num-2
print(ans)
(lambda __g, __y, __operator, __print: [[(a.sort(), [(lambda __items, __after, __sentinel: __y(lambda __this: lambda: (lambda __i: [(lambda __after: [__after() for __g['mx'] in [(__operator.isub(__g['mx'], i))]][0] if (i < 0) else [__after() for __g['mn'] in [(__operator.isub(__g['mn'], i))]][0])(lambda: __this()) for __g['i'] in [(__i)]][0] if __i is not __sentinel else __after())(next(__items, __sentinel)))())(iter(a[1:-1]), lambda: (__print((mx - mn)), [(lambda __items, __after, __sentinel: __y(lambda __this: lambda: (lambda __i: [(lambda __after: (__print(((str(mx) + ' ') + str(i))), [__after() for __g['mx'] in [(__operator.isub(__g['mx'], i))]][0])[1] if (i < 0) else (__print(((str(mn) + ' ') + str(i))), [__after() for __g['mn'] in [(__operator.isub(__g['mn'], i))]][0])[1])(lambda: __this()) for __g['i'] in [(__i)]][0] if __i is not __sentinel else __after())(next(__items, __sentinel)))())(iter(a[1:-1]), lambda: (__print(((str(mx) + ' ') + str(mn))), None)[1], []) for (__g['mn'], __g['mx']) in [((a[0], a[-1]))]][0])[1], []) for (__g['mn'], __g['mx']) in [((a[0], a[-1]))]][0])[1] for __g['a'] in [(list(map(int, input().split())))]][0] for __g['n'] in [(int(input()))]][0])(globals(), (lambda f: (lambda x: x(x))(lambda y: f(lambda: y(y)()))), __import__('operator', level=0), __import__('builtins', level=0).__dict__['print'])

### FIXED CODE ###

n,a=int(input()),sorted(list(map(int,input().split())))
mn,mx=a[0],a[-1]
for i in a[1:-1]:
  if i<0:mx-=i
  else:mn-=i
print(mx-mn)
mn,mx=a[0],a[-1]
for i in a[1:-1]:
  if i<0:print(mx,i);mx-=i
  else:print(mn,i);mn-=i
print(mx,mn)
L=[]
s=int(raw_input())
L+=divmod(s,3600)
L+=divmod(L[1],60)
print ({0}:{1}:{2}).format(L[0],L[2],L[3])

### FIXED CODE ###

L=[]
s=int(raw_input())
L+=divmod(s,3600)
L+=divmod(L[1],60)
print ("{0}:{1}:{2}").format(L[0],L[2],L[3])
import sys
sys.setrecursionlimit(10**10)
N = int(input())
S = input()

count = -1

def dfs(index, moji):
    global N,S,count
    if index==N:
        count+=1
        return
    if S[index] in moji:
        dfs(index+1, moji)
    else:
        dfs(index+1, moji)
        dfs(index+1, moji+S[index])

dfs(0,'')
print(count)

### FIXED CODE ###

N = int(input())
S = input()
MOD = 10**9+7

alp = 'abcdefghijklmnopqrstuvwxyz'
count_alp = [0 for i in range(26)]
count = 1

for s in S:
    count_alp[alp.find(s)]+=1

for i in count_alp:
    count*= (i+1)
print((count-1)%MOD)
a b c d = map(int,input().split())
dis_ab = abs(a-b)
dis_bc = abs(b-c)
 
if dis_ab <= d and dis_bc <= d:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a,b,c,d = map(int,input().split())
dis_ab = abs(a-b)
dis_bc = abs(b-c)
dis_ac = abs(a-c)

if dis_ab <= d and dis_bc <= d:
  print('Yes')
elif dis_ac <= d:
  print('Yes')
else:
  print('No')
import math
a,b=map(int,input().split())
print((a*b)//math.gcd(a,b))

### FIXED CODE ###

from fractions import gcd
a,b=map(int,input().split())
print((a*b)//gcd(a,b))
o = input()
e = input()

s = ""
for i in range(len(o)):
    s += o[i] + e[i]
print(s)

### FIXED CODE ###

o = input()
e = input()

a = len(o)-len(e)
s = ""

if a == 0:
    for i in range(len(o)):
         s += o[i] + e[i]
else:
    for i in range(len(o)-1):
        s += o[i] + e[i]
    s += o[len(o)-1]
print(s)
N,K = map(int, input().split())
N += 1 ; K += 1
H = list(map(int, input().split()))
L = [0] + [1000000000]*N
for i in range (N):
  for j in range(i+1, min(i+K, N-1)):
    L[j] = min(L[j], L[i] + abs(H[j] - H[i]))
print(L[N-2])

### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
L = [0]*N
L[1] = abs(H[1] - H[0])
for i in range (2,N):
  X = L[i-1] + abs(H[i] - H[i-1])
  Y = L[i-2] + abs(H[i] - H[i-2])
  L[i] = min(X,Y)
print(L[N-1])
a,b,x=map(int,input().split())
print("YES" a<=x or x<=a+b else "NO" )

### FIXED CODE ###

a,b,x=map(int,input().split())
print("YES" if a<=x and x<=a+b else "NO" )
N = input()
n1 = N % 10

if n1 in (2,4,5,7,9):
  print('hon')
elif n1 in (0,1,6,8):
  print('pon')
else:
  print('bon')


### FIXED CODE ###

N = input()
num = int(N) % 10

if num in (2,4,5,7,9):
  print('hon')
elif num in (0,1,6,8):
  print('pon')
else:
  print('bon')
mod = 10**9+7

f = [1]*(2*10**6+2)
f[0] = 1
for i in range(1,2*10**6+2):
    f[i] = f[i-1]*i%mod

def inv(i):
    return pow(f[i],mod-2,mod)

def g(x,y):
    return f[x+y]*inv(x)*inv(y)%mod

r1,c1,r2,c2 = map(int,input().split(" "))
ans = g(r2+1,c2+1)-g(r2+1,c1)-g(r1,c2+1)+g(r1,c1)
print(ans%mod)

### FIXED CODE ###

mod = 10**9+7

f = [1]*(2*10**6+5)
f[0] = 1
for i in range(1,2*10**6+4):
    f[i] = f[i-1]*i%mod

def inv(i):
    return pow(f[i],mod-2,mod)

def g(x,y):
    return f[x+y]*inv(x)*inv(y)%mod

r1,c1,r2,c2 = map(int,input().split(" "))
ans = g(r2+1,c2+1)-g(r2+1,c1)-g(r1,c2+1)+g(r1,c1)
print(ans%mod)
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(n)]
ab.sort()
ans = 0
cnt = 0
i = 0
while cnt < m:
    ans += ab[i][0]*ab[i][1]
    cnt += ab[i][1]
    i += 1
print(num - (cnt - m)*ab[i][0])

### FIXED CODE ###

n,m = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(n)]
ab.sort()
ans = 0
cnt = 0
i = 0
while cnt < m:
    ans += ab[i][0]*ab[i][1]
    cnt += ab[i][1]
    i += 1
print(ans - (cnt - m)*ab[i-1][0])
import math
import copy
from functools import reduce

N = int(input())
yaku = [0]*N
X = input().split()
X = list(map(int, X))


def gcd_list(numbers):
    return reduce(math.gcd, numbers)


for i in range(N):
    Xwork = copy.copy(X)
    del(Xwork[i])
    yaku[i] = gcd_list(Xwork)

print(max(yaku))


### FIXED CODE ###

from fractions import gcd
N = int(input())
A = list(map(int,input().split()))
L_A = [0] * (N+1)
R_A = [0] * (N+1)
for i in range(N):
    L_A[1+i] = gcd(L_A[i], A[i])
for i in reversed(range(N)):
    R_A[i] = gcd(R_A[i+1], A[i])
print(max(gcd(L_A[i], R_A[i+1]) for i in range(N)))
results=[]
while True:
    a=input().split("\"")
    if a[0]==".":
        break
    b=input().split("\"")
    count1=0
    count2=0
    print(a)
    print(b)
    for i in range(int(len(a))):
        if(i%2==1):
            for k,l in zip(a[i],b[i]):
                if(k!=l):
                    count1+=1
        else:
            for k,l in zip(a[i],b[i]):
                if(k!=l):
                    count2+=1
        if len(a) != len(b):
            results.append(2)
        else:
            if count1==0 and count2==0:
                results.append(0)
            elif count1==1 and count2==0:
                results.append(1)
            else:
                results.append(2)
for i in results:
    if i==0:
        print("IDENTICAL")
    if i==1:
        print("CLOSE")
    if i==2:
        print("DIFFERENT")
    



### FIXED CODE ###

results=[]
while True:
    a=input().split("\"")
    if a[0]==".":
        break
    b=input().split("\"")
    count1=0
    count2=0
    if len(a) != len(b):
        results.append(2)
    else:
        for i in range(len(a)):
            if(i%2==1):
                if len(a[i]) != len(b[i]):
                    count1+=1
                else:
                    for k,l in zip(a[i],b[i]):
                        if(k!=l):
                            count1+=1
            else:
                if len(a[i]) != len(b[i]):
                    count2+=1
                else:
                    for k,l in zip(a[i],b[i]):
                        if(k!=l):
                            count2+=1           
        if count1==0 and count2==0:
            results.append(0)
        elif count1==1 and count2==0:
            results.append(1)
        else:
            results.append(2)
for i in results:
    if i==0:
        print("IDENTICAL")
    if i==1:
        print("CLOSE")
    if i==2:
        print("DIFFERENT")
x = input().split()
y = int(x[0])*int(x[1])
if y%2 = 1:
  print("Odd")
else:
  print("Even")

### FIXED CODE ###

a, b = map(int, input().split())
if (a*b) % 2:
  print("Odd")
else:
  print("Even")
h,w = map(int,input().split())
s = [input() for _ in range(w)]
ans=[]
for i in range(w):
    ans.append(s[i])
    ans.append(s[i])
for i in range(w*2):
    print(ans[i])

### FIXED CODE ###

h,w = map(int,input().split())
s = [input() for _ in range(h)]
ans=[]
for i in range(h):
    ans.append(s[i])
    ans.append(s[i])
for i in range(h*2):
    print(ans[i])
n,a,b=map(int, input().split())

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 
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 )

def pos(x, n, m):
    if n == 0:
        return 1
    res = pos(x*x%m, n//2, m)
    if n%2 == 1:
        res = res*x%m
    return res
    
if n==2:
    print(0)
else:
    ans=pos(2,n,mod)-1-comb(n,a,mod)-comb(n,b,mod)
    print(ans)

### FIXED CODE ###

n,a,b=map(int, input().split())
 
def comb(n, r,MOD):
    p, q = 1, 1
    for i in range(r):
        p = p * (n-i) % MOD
        q = q * (i+1) % MOD
    return p * pow(q, MOD-2, MOD) % MOD

mod=10**9+7
    
A=comb(n,a,mod)
B=comb(n,b,mod)  
C=pow(2,n,mod)

if n==2:
    print(0)
else:
    print((C-1-A-B)%mod)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n, m = map(int, readline().split())
a = list(map(int, readline().split()))
memo = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
dp = [0] * (n + 1)
for aa in a:
    dp[memo[aa]] = max(dp[memo[aa]], aa)
for i in range(n):
    if dp[i] == 0:
        continue
    for aa in a:
        if i + memo[aa] <= n:
            v = int(str(aa) + str(dp[i]))
            if dp[i + memo[aa]] < v:
                dp[i + memo[aa]] = v
print(dp[-1])


### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n, m = map(int, readline().split())
a = list(map(int, readline().split()))
memo = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
dp = [''] * (n + 1)
for aa in a:
    if memo[aa] <= n:
        dp[memo[aa]] = max(dp[memo[aa]], str(aa))
for i in range(n):
    if dp[i] == '':
        continue
    for aa in a:
        if i + memo[aa] <= n:
            v = str(aa) + dp[i]
            if len(dp[i + memo[aa]]) < len(v):
                dp[i + memo[aa]] = v
            else:
                dp[i + memo[aa]] = max(dp[i + memo[aa]], v)
print(dp[-1])
N, K = map(int, input().split())
# 今回は、等差数列の和の差をとって、


def calc(x):
    a = x * (x - 1) // 2
    b = (2 N - x + 1) * x // 2
    return a - b + 1


for i in range(K, N + 2):
    ans = calc(i)
    tot = +=ans

tot /= 10 ** 9 + 7

print(tot)


### FIXED CODE ###

N, K = map(int, input().split())
# 小さい方から順にk個とったものと、大きい方から順にk個とったものの差
# １刻みから作る最小と最大間は、全てを満たす


def calc(x, N):
    a = x * (x - 1) // 2
    b = (2 * N - x + 1) * x // 2
    return b - a + 1


tot = 0
for i in range(K, N + 2):
    ans = calc(i, N)
 #   print(ans)
    tot += ans

aa = tot % (10 ** 9 + 7)

print(aa)