Harryxun/stf_run huggingface dataset:
def cos_per_find(count, cost, skills):
    if count == N:
        if min(skills) >= X:
            return cost
        else:
            return INF
    improved_skills = [a+b for a, b in zip(skills, contents[count])]
    return min(cos_per_find(count+1, cost, skills), cos_per_find(count+1, cost+price[count], improved_skills))

INF = float(inf)
N, M, X = map(int, input().split())
price = []
contents = []
for i in range(N):
    C, *A = map(int, input().split())
    price.append(C)
    contents.append(A)
ans = cos_per_find(0, 0, [0]*M)
if ans == INF:
    print(-1)
else:
    print(ans)

### FIXED CODE ###

def cos_per_find(count, cost, skills):
    if count == N:
        if min(skills) >= X:
            return cost
        else:
            return INF
    improved_skills = [a+b for a, b in zip(skills, contents[count])]
    return min(cos_per_find(count+1, cost, skills), cos_per_find(count+1, cost+price[count], improved_skills))

INF = float('inf')
N, M, X = map(int, input().split())
price = []
contents = []
for i in range(N):
    C, *A = map(int, input().split())
    price.append(C)
    contents.append(A)
if (ans := cos_per_find(0, 0, [0]*M)) == INF:
    print(-1)
else:
    print(ans)
from heapq import *

def solve(p:list):
    s = 0
    n = len(p)
    data = [[] for _ in range(n+1)]
    for i,j in p:
        data[min(i,n)].append(j)
    H = []
    heapify(H)
    for i in range(n,0,-1):
        for j in data[i]:
            heappush(H,-j)
        if H:
            s -= heappop(H)
    return s
    
t = int(input())
for _ in range(t):
    n = int(input())
    ans = 0
    pl = []
    pr = []
    for _ in range(n):
        k,l,r = map(int,input().split())
        m = min(l,r)
        ans += m
        l,r = l-m,r-m
        if l:
            pl.append((k,l))
        else:
            pr.append((n-k,r))
    print(ans+solve(pl)+solve(pr))

### FIXED CODE ###

l,r,d = map(int,input().split())
a = (l-1)//d
b = r//d
print(b-a)
N, A, B = map(int, input().split())

counter = [0 for _ in range(N)]
ans = 0
for i in range(N):
    string = str(i)
    for j in range(len(str)):
        counter[i] += string[j]
    if(counter[i]>=A and counter[i]<=B):
        ans += i
print(ans)

### FIXED CODE ###

N, A, B = map(int, input().split())
ans = 0

for i in range(1, N+1):
    num_sum = 0
    for j in str(i):
        num_sum += int(j)
    if A<= num_sum <= B:
        ans += i

print(ans)
X = int(input())

a = 0
b = 0
c = 0
d = 0
e = 0
f = 0

for q in range(100):
    for w in range(100):
        for e in range(100):
            for r in range(100):
                for t in range(100):
                    for y in range(100):
                        num = (500 * q) + (100 * w) + (50 * e) + (10 * r) + (5 * t) + (1 * y)
                        if X % num == 0:
                            m = q
                            i = t
                            break


print(500 * m + 5 * i)

### FIXED CODE ###

X = int(input())

C = 0
P = 0
D = 0
L = 0
total = 0

if X >= 0 and X <= 10 ** 9:
    while True:
        if X >= 500:
            C = X // 500
            P = 500 * C
            X = X - P
        elif X >= 5:
            D = X // 5
            L = 5 * D
            X = X - L
        else:
            break
man = 1000 * C
t   = 5 * D

total = man + t

print(total)
(N, K) = map(int, input().split(" "))
S = input()

nowOn = S[0]
count = 0
serialList = []

for i in S:

    if(nowOn == i):
        count += 1

    else:
        serialList.append(count)
        count = 1
        nowOn = i

serialList.append(count)

T = 2 * K + 1
A = 0

#serialList -> ["1", "0", "1", "0", ...]
if S[0] == "0":
    serialList.insert(0, 0)
    
#exception
# --???

maxA = 0
for i in range(T):
    A += serialList[i]
    maxA = A
    
for i in range(T, len(serialList), 2):
    A -= serialList[i - T]
    A -= serialList[i - T + 1]
    A += serialList[i]

    if(i+1 < len(serialList)):
        A += serialList[i + 1]

    if maxA < A:
        maxA = A
        
print(maxA)



### FIXED CODE ###

import sys

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

nowOn = S[0]
count = 0
serialList = []

for i in S:

    if(nowOn == i):
        count += 1

    else:
        serialList.append(count)
        count = 1
        nowOn = i

serialList.append(count)

T = 2 * K + 1
A = 0

#serialList -> ["1", "0", "1", "0", ...]
if S[0] == "0":
    serialList.insert(0, 0)
    
#exception
if int(len(serialList) / 2) < K:
    print(len(S))
    sys.exit()

maxA = 0
for i in range(T):
    A += serialList[i]
    maxA = A
    
for i in range(T, len(serialList), 2):
    A -= serialList[i - T]
    A -= serialList[i - T + 1]
    A += serialList[i]

    if(i+1 < len(serialList)):
        A += serialList[i + 1]

    if maxA < A:
        maxA = A
        
print(maxA)
import numpy as np

N = input()
a_list = np.array(list(map(int, input().split())))
b_list = np.array(list(map(int, input().split())))

#  # すべての準備度が必要度を上回っている場合
#  if all([a >= b for a, b in zip(a_list, b_list)]):
#      print(0)
#  # 準備度が足りていない試験がある場合
#  else:
# そもそも準備度の総量が足りない場合
if sum(a_list) < sum(b_list):
    print(-1)
else:
    # 準備度を移動すれば受かる場合
    # 一番数の大きいところから足りていないところに割り振る戦略
    # a_listをcopy
    # 準備度の余裕をリストに格納
    diff_list = a_list - b_list
    diff_list.sort()
    start = 0
    end = -1
    current_value = diff[end]
    while current_value < 0:
        current_value += diff_list[i]
        while current_value < 0:
            end -= 1
            a += diff[end]
        start += 1
    if start == 0:
        print(0)
    else:
        print(i - j)


### FIXED CODE ###

import numpy as np

N = input()
a_list = np.array(list(map(int, input().split())))
b_list = np.array(list(map(int, input().split())))

#  # すべての準備度が必要度を上回っている場合
#  if all([a >= b for a, b in zip(a_list, b_list)]):
#      print(0)
#  # 準備度が足りていない試験がある場合
#  else:
# そもそも準備度の総量が足りない場合
if sum(a_list) < sum(b_list):
    print(-1)
else:
    # 準備度を移動すれば受かる場合
    # 一番数の大きいところから足りていないところに割り振る戦略
    # a_listをcopy
    # 準備度の余裕をリストに格納
    diff_list = a_list - b_list
    # 昇順にソート
    diff_list.sort()
    start = 0
    end = -1
    current_value = diff_list[end]
    while diff_list[start] < 0:
        # 最大値から減算
        current_value += diff_list[start]
        while current_value < 0:
            end -= 1
            current_value += diff_list[end]
        start += 1
    if start == 0:
        print(0)
    else:
        print(start - end)
input()

if S[0] == S[1] and S[1] == S[2]:
    print('No')
else:
    print('Yes')

### FIXED CODE ###

S = input()

if S[0] == S[1] and S[1] == S[2]:
    print('No')
else:
    print('Yes')
# 末端の頂点は白1通り、黒1通り
# それ以外の頂点は、各子どもの頂点を元に、白:子の全ての場合分けの積、黒:子が全て白の場合分けの積
# で更新していく

N = int(input())
G = [[] for i in range(N)]
MOD = 10 ** 9 + 7

for i in range(N - 1):
  x,y = map(int,input().split())
  G[x - 1].append(y - 1)
  G[y - 1].append(x - 1)
  
dp_black = [-1] * N
dp_white = [-1] * N

# 頂点vの(黒,白)の場合の数を求める
def search(v,parent):
  if dp_black[v] != -1:
    return (dp_black[v],dp_white[v])
  black = 1
  white = 1
  for child in G[v]:
    if child == parent:
      continue
    b,w = search(child, v)
    black *= w
    black %= MOD
    white *= (b + w)
    white %= MOD
  dp_black[v] = black
  dp_white[v] = white
  return (black, white)

print(sum(search(0, -1)) % MOD)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)

# 末端の頂点は白1通り、黒1通り
# それ以外の頂点は、各子どもの頂点を元に、白:子の全ての場合分けの積、黒:子が全て白の場合分けの積
# で更新していく

N = int(input())
G = [[] for i in range(N)]
MOD = 10 ** 9 + 7

for i in range(N - 1):
  x,y = map(int,input().split())
  G[x - 1].append(y - 1)
  G[y - 1].append(x - 1)
  
dp_black = [-1] * N
dp_white = [-1] * N

# 頂点vの(黒,白)の場合の数を求める
def search(v,parent):
  if dp_black[v] != -1:
    return (dp_black[v],dp_white[v])
  black = 1
  white = 1
  for child in G[v]:
    if child == parent:
      continue
    b,w = search(child, v)
    black *= w
    black %= MOD
    white *= (b + w)
    white %= MOD
  dp_black[v] = black
  dp_white[v] = white
  return (black, white)

print(sum(search(0, -1)) % MOD)
N = input()
print(str(N**3))

### FIXED CODE ###

N =input()
print(int(N)**3)
dist = {"MON":0,"TUE":1,"WED":2,"THU":3,"FRI":4,"SAT":5,"FRI":6,"SUN":7}
i = str(input())
if i == "SUN":
  print(7)
else:
  print(dist["SUN"]-dist(i))



### FIXED CODE ###

dist = {"MON":1,"TUE":2,"WED":3,"THU":4,"FRI":5,"SAT":6,"SUN":7}
i = str(input())
if i == "SUN":
  print(7)
else:
  print(dist["SUN"]-dist[i])
A, B, N = map(int,input().split())
if(B-A < N) :
 cal = int((A*N)/B) - A*int(N/B)
 print(cal)
else 
 max = 0
 i=N
 while(1):
  cal = int((A*i)/B) - A*int(i/B)
  if(cal > max):
   max =cal
  i += -1
  if(i < 0):
   print(max)
   break;

### FIXED CODE ###

K = int(input())
A, B = map(int,input().split())
number = A
count = 0
while(1):
 if(number%K == 0):
  count +=1
 number += 1  
 if(number > B):
  if(count >0):
    print("OK")
  else:
    print("NG")
  break;
import sys,bisect
from math import gcd
input = sys.stdin.readline

############ ---- USER DEFINED INPUT FUNCTIONS ---- ############
def inp():
    return(int(input().rstrip()))
def inlt():
    return(list(map(int,input().rstrip().split())))
def insr():
    s = input().rstrip()
    return(s[:len(s) - 1])
def invr():
    return(map(int,input().rstrip().split()))
################################################################
n = inp()
remain = n - (n//500)*500

print((n//500)*1000 + 5*(remain//5))
#print()


### FIXED CODE ###



############ ---- USER DEFINED INPUT FUNCTIONS ---- ############
def inp():
    return(int(input().rstrip()))
def inlt():
    return(list(map(int,input().rstrip().split())))
def insr():
    s = input().rstrip()
    return(s[:len(s) - 1])
def invr():
    return(map(int,input().rstrip().split()))
################################################################
n = inp()
remain = n - (n//500)*500

print((n//500)*1000 + 5*(remain//5))
#print()
n, q = map(int, input().split())
s = input()
t = [None] * q
d = [None] * q
for i in range(q):
    t[i], d[i] = input().split()
l, r = 0, n + 1
while r - l > 1:
    m = (l + r) // 2
    c = m - 1
    for i in range(q):
        if s[c] == t[i]:
            if d[i] == 'L':
                c -= 1
            else:
                c += 1
        if c < 0:
            l = m
            break
    else:
        r = m
a = l
l, r = 0, n + 1
while r - l > 1:
    m = (l + r) // 2
    c = m - 1
    for i in range(q):
        if s[c] == t[i]:
            if d[i] == 'L':
                c -= 1
            else:
                c += 1
        if c >= n:
            r = m
            break
    else:
        l = m
b = n - l
print(max(0, n - a - b))


### FIXED CODE ###

n, q = map(int, input().split())
s = input()
t = [None] * q
d = [None] * q
for i in range(q):
    t[i], d[i] = input().split()
l, r = 0, n + 1
while r - l > 1:
    m = (l + r) // 2
    c = m - 1
    for i in range(q):
        if c >= 0 and s[c] == t[i]:
            if d[i] == 'L':
                c -= 1
            else:
                c += 1
        if c < 0:
            l = m
            break
        if c >= n:
            r = m
            break
    else:
        r = m
a = l
l, r = 0, n + 1
while r - l > 1:
    m = (l + r) // 2
    c = m - 1
    for i in range(q):
        if c < n and s[c] == t[i]:
            if d[i] == 'L':
                c -= 1
            else:
                c += 1
        if c >= n:
            r = m
            break
        if c < 0:
            l = m
            break
    else:
        l = m
b = n - l
print(max(0, n - a - b))
heights = list()
for i in range(10):
    heights.append(int(input()))
for height in reversed(sorted(heights))[:3]:
    print(height)

### FIXED CODE ###

heights = list()
for i in range(10):
    heights.append(int(input()))
for height in list(reversed(sorted(heights)))[:3]:
    print(height)
a = int(input())
S = input()

if a >= 3200:
	print(S)
else:
	print(red)

### FIXED CODE ###

a = int(input())
S = input()

if a >= 3200:
	print(S)
else:
	print("red")
yobi = [MON,TUE,WED,THU,FRI,SAT,SUN]
s = input()
for i in range(7):
  if s == yobi[i]:
    print(i+1)

### FIXED CODE ###

yobi = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
yobi.reverse()
s = input()
for i in range(7):
  if s == yobi[i]:
    print(i+1)
print(x*x*x)

### FIXED CODE ###

x = int(input())
print(x*x*x)
S = dict()
S['A'] = list(input())[::-1]
S['B'] = list(input())[::-1]
S['C'] = list(input())[::-1]

print(S)
player = 'a'

while S[player]:
    player = S[player].pop() 

ans = player.upper()
print(ans)

### FIXED CODE ###

S = dict()
S['a'] = list(input())[::-1]
S['b'] = list(input())[::-1]
S['c'] = list(input())[::-1]

player = 'a'

while S[player]:
    player = S[player].pop() 

ans = player.upper()
print(ans)
if a*b % =0:
	print(even)
else:
    print(odd)

### FIXED CODE ###

a, b = map(int, input().split())
if (a*b) % 2:
  print("Odd")
else:
  print("Even")
line = input().split()
x = int(line[1])
ans = 0
 
a = sorted(input().split())
map(int, a)
 
for i in len(a):
  if a[i] > x:
    print(ans)
    break
  else:
    x-=a[i]
    if i!=len(a)-1:
      ans+=1
    else:
      if x==0:
        ans+=1
      print(ans)

### FIXED CODE ###

line = input().split()
N = int(line[0])
x = int(line[1])
ans = 0

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

for i in range(N):
    if a[i] > x:
        print(ans)
        break
    else:
        x -= a[i]
        if i != (N - 1):
            ans += 1
        else:
            if x == 0:
                ans += 1
            print(ans)
from collections import deque
N,H = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(N)]
AB_a = sorted(AB, reverse = True, key=lambda x: x[0])
AB_b = deque(sorted(AB, reverse = True, key=lambda x: x[1]))
damage = 0
count = 0

while damage < H:
  if AB_b[0][1] > AB_a[0][0]:
    damage += AB_b[0][1]
    AB_b.popleft()
  else:
    damage += AB_a[0][0]
  count += 1
print(count)

### FIXED CODE ###

from bisect import bisect_left
N,H = map(int,input().split())
A = [0]*N
B = [0]*N

for i in range(N):
  a,b = map(int,input().split())
  A[i] = a
  B[i] = b

A = max(A)
B = sorted(B)

count,damage = 0,0
b = bisect_left(B,A)

for i in range(len(B)-1,b-1,-1):
  damage += B[i]
  count += 1
  if damage >= H:
    print(count)
    exit()

count,damage = 0,0
damage = sum(B[b:])
count += len(B[b:])
count += (H-damage)//A
damage = H - (H-damage)%A
if damage == H:
  pass
else:
  count += 1
print(count)
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
numa=[0]
numb=[0]
for i in range(n):
    if numa[-1]+a[i]>k:
        break
    numa.append(numa[-1]+a[i])
for j in range(m):
    if numb[-1]+b[i]>k:
        break
    numb.append(numb[-1]+b[i])
n=len(numa)
m=len(numb)
ans=0
for i in range(n):
    num1=k-numa[i]
    for j in range(m):
        if numb[m-j-1]<=num1:
            break
        m-=1
    ans=max(ans,i+m-1)
print(ans)


### FIXED CODE ###

n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
if sum(a)+sum(b)<k:
    ans=m+n
else:
    numa=[0]
    numb=[0]
    for i in range(n):
        numa.append(numa[-1]+a[i])
    for j in range(m):
        numb.append(numb[-1]+b[j])
    ans=0
    for i in range(n+1):
        if numa[i]>k:
            break
        while numb[m]>k-numa[i]:
            m-=1
        ans=max(ans,i+m)
print(ans)
print("縦と横の長さを入力")

a=int(input())
b=int(input())

print(str(a*b))
print(str(a*2+b*2))



### FIXED CODE ###


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

r=a*b
length=a*2+b*2
print(r,length)
#!/usr/bin/env python3
import sys
import numpy as np

YES = "Yes"  # type: str
NO = "No"  # type: str

def solve(H: int, W: int, s: "List[str]"):
    count = 0
    numofshirp = 0
    for s_ in s:
        numofshirp += s_.count("#")

    #padding
    edge = ["".join(["."] * (W + 2))]
    for i, si in enumerate(s):
        s[i] = "".join("."+si+".")
    s.extend(edge)
    edge.extend(s)

    for i, ei in enumerate(edge):
        for j, eij in enumerate(ei):
            if eij == "#":
                if "#" in (edge[i - 1][j], edge[i + 1][j], edge[i][j - 1], edge[i][j + 1]):
                    count += 1

    if count == numofshirp:
        print(YES)
    else:
        print(NO)

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    s = [next(tokens) for _ in range(W)]  # type: "List[str]"
    solve(H, W, s)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
import numpy as np

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(H: int, W: int, s: "List[str]"):
    ans = YES
    for i in range(1, H-1):
        for j in range(1, W-1):
            if s[i][j] == "#" and s[i-1][j] == s[i+1][j] == s[i][j-1] == s[i][j+1] == ".":
                ans = NO
    print(ans)

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    H, W = map(int,input().split())  # type: int
    s = [input() for _ in range(H)]  # type: "List[str]"
    solve(H, W, s)

if __name__ == '__main__':
    main()
N, M = map(int, input().split())

S = []
C = []
for _ in range(M):
    s, c = map(int, input().split())
    S.append(s)
    C.append(c)

ans = [[] for _ in range(M)]

for i in range(M):
    ans[S[i]-1].append(C[i])

ans2 = []

for i in ans:
    if len(set(i)) > 1:
        print(-1)
        exit()
    if len(i) == 0:
        ans2.append(0)
        continue
    ans2.append(list(set(i))[0])

if ans2[0] == 0:
    print(-1)
    exit()

print(''.join(map(str,ans2)))
    

### FIXED CODE ###

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

if M >= 1:
    S = []
    C = []
    for _ in range(M):
        s, c = map(int, input().split())
        S.append(s)
        C.append(c)
else:
    if N == 3:
        print(100)
    elif N == 2:
        print(10)
    else:
        print(0)
    exit()

ans = [[] for _ in range(N)]

for i in range(M):
    ans[S[i]-1].append(C[i])

ans2 = []

for i in range(len(ans)):
    if len(set(ans[i])) > 1:
        print(-1)
        exit()
    if len(ans[i]) == 0:
        if i == 0:
            ans2.append(1)
        else:
            ans2.append(0)
        continue
    ans2.append(list(set(ans[i]))[0])

if ans2[0] == 0:
    if N == 1:
        print(0)
        exit()
    else:
        print(-1)
        exit()

print(''.join(map(str,ans2)))
n, k = map(int, input().split())
res = 0
while n >= k:
  res += 1
  n //= k
print(res+1)

### FIXED CODE ###

n, r = map(int, input().split(' '))
if n < 10:
  ans = r + 100 * (10-n)
else:
  ans = r
print(ans)
import numpy as np
import sys
input = sys.stdin.readline


def main():
    R, G, B, N = [int(ele) for ele in input().split()]
    ans = 0
    for i in range(N+1):
        tmp = N - i*R

        for j in range(N+1):
            tmp2 = tmp - j*G
            if tmp2 < 0:
                break
            if tmp2 % B == 0:
                ans += 1

    print(ans)


def make_prim_nu(n):
    np.set_printoptions(threshold=np.inf)   # 配列の ... 表示を抑制
    N = n                  # 引数の上限値を含める
    is_prime = np.ones((N,), dtype=bool)
    is_prime[:2] = 0
    N_max = int(np.sqrt(N))
    for j in range(2, N_max+1):
        if(is_prime[j]):
            is_prime[j*j::j] = False        # 素数jの間隔で消していく
    primes = np.arange(N)[is_prime]
    return primes


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)

    return divisors


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline


def main():
    R, G, B, N = [int(ele) for ele in input().split()]
    ans = 0
    for i in range(N+1):
        tmp = N - i*R

        for j in range(N+1):
            tmp2 = tmp - j*G
            if tmp2 < 0:
                break
            if tmp2 % B == 0:
                ans += 1

    print(ans)


if __name__ == "__main__":
    main()
import numpy as np

S = input()
N = len(S)
arr = np.zeros((N, N), dtype=np.int)
for n, s in enumerate(S):
    i = n
    j = n + (1 if s == 'R' else -1)
    arr[i, j] += 1
mat = np.matrix(arr)
#print(*(np.ones(N, dtype=np.int) * (mat ** 10 ** 100)).tolist()[0])
print(0)

### FIXED CODE ###

import numpy as np
from scipy.sparse import csr_matrix

S = input()
N = len(S)
row = tuple(range(N))
col = [n + (1 if s == 'R' else -1) for n, s in enumerate(S)]
data = [1] * N
mat = csr_matrix((data, (row, col)), shape=(N, N))
print(*np.ones(N, dtype=np.int) * (mat ** 10 ** 100))
from math import gcd

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

c=max(A)
D=[0]*(c+1)
div=[0]*(c+1)
P=[]

for i in range(2,c+1):
    if D[i]==0:
        P.append(i)
        D[i]=i
    for j in P:
        if i*j>c:
           break
        D[i*j]=j

for i in A:
    c=gcd(c,i)
    temp=i
    if temp==D[temp]:
        div[temp]+=1
        continue
    while temp!=D[temp]:
        div[D[temp]]+=1
        temp=temp//D[temp]

if max(div)<=1:
    print('pairwise coprime')

elif c==1:
    print('setwise coprime')

else:
    print('not coprime')

### FIXED CODE ###

from functools import reduce
from math import gcd

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

c=max(A)+1
D=[0]*c
div=[0]*c
P=[]

for i in range(2,c):
    if D[i]==0:
        P.append(i)
        D[i]=i
    for j in P:
        if i*j>=c  or j>D[i] :
           break
        D[i*j]=j
f=0
for i in A:
    if i==1:
        continue
    temp=i
    while temp!=1:
        if div[D[temp]]==1:
            f=1
            break
        div[D[temp]]+=1
        temp2=D[temp]
        while temp%temp2==0 and temp>=temp2:
            temp=temp//temp2
    if f==1:
        break
        


if max(div)<=1 and f==0:
    print('pairwise coprime')

elif reduce(gcd, A) == 1:
    print('setwise coprime')

else:
    print('not coprime')
import math
tol = 1e-6
ans = 1
cur = [0,0]
cur[0] += math.cos(ans*math.pi/x)
cur[1] += math.sin(ans*math.pi/x)
while cur[0]**2 + cur[1]**2 > tol:
    ans += 1
    cur[0] += math.cos(ans*math.pi/x)
    cur[1] += math.sin(ans*math.pi/x)
print(ans)

### FIXED CODE ###

import math
x = int(input())
tol = 1e-6
ans = 1
cur = [0,1]
unit = x/180*math.pi
while cur[0]**2 + cur[1]**2 > tol:
    cur[0] += math.sin(ans*unit)
    cur[1] += math.cos(ans*unit)
    ans += 1
print(ans)
a, b = map(int, input(), split())
if a == b:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

a, b = map(int, input().split())
if a == b:
    print("Yes")
else:
    print("No")
times=list(map(int, input().split()))
time=[]
for i in range(len(times)):
    for j in range(len(times)):
        if times.index(times[i]) == times.index(times[j]):
            continue
        
        time.append(times[i]+times[j])

print (min(time))


### FIXED CODE ###

p,q,r = map(int, input().split())
print(min(p+q, q+r, r+p))
a, b = int(input())

if a%b == 0:
  print('Even')
else:
  print('Odd')

### FIXED CODE ###

a, b = map(int, input().split())
 
if (a*b) % 2 :
  print('Odd')
else:
  print('Even')
inp = [int(i) for i in input().split()]
n = inp[0]
a = inp[1]
b = inp[2]

C = {}
def cmb(n,r):
  print(n,r)
  if r==0 or r ==n:
    return 1
  if r==1:
    return n
  if (n,r) in C:
    return C[(n,r)]
  C[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
  return C[(n,r)]
  
A = cmb(n,a)
B = cmb(n,b)
ans = 2**n-1-A-B
print(ans%(10**9+7))

### FIXED CODE ###

import math
n,a,b = [int(i) for i in input().split()]
mod = 10**9+7
  
def comb(n,k):
  ans = 1
  for i in range(k):
    ans = ans*(n-i)%mod
  for i in range(1,k+1):
    ans = ans*pow(i,mod-2,mod)%mod
  return ans

print((pow(2,n,mod)-1-comb(n,a)-comb(n,b))%mod)
# print(comb(n,a))