Harryxun/stf_run huggingface dataset:
from scipy.sparse.csgraph import dijkstra
n,m,s,t=map(int,input().split())

E=[[10**15 for j in range(n+1)]for i in range(n+1)]
S=[[10**15 for j in range(n+1)]for i in range(n+1)]

for i in range(m):
    x,y,a,b=map(int,input().split())
    E[x][y]=a
    E[y][x]=a
    S[x][y]=b
    S[y][x]=b
    
#print(E)
#print(S)
E=dijkstra(E,indices = s)
S=dijkstra(S,indices = t)
#print(E)
#print(S)

Q=[]
for i in range(1,n+1):
    Q.append((int(E[i]+S[i]),i))

Q.sort()
cnt=0
for i in range(1,n+1):
    while Q[cnt][1]<i:
        cnt+=1
    print(10**15-Q[cnt][0])
#print(Q)

### FIXED CODE ###

n,m,s,t=map(int,input().split())

en=[[]for i in range(n+1)]
sn=[[]for i in range(n+1)]

for i in range(m):
    u,v,a,b=map(int,input().split())
    en[v].append((u,a))
    en[u].append((v,a))
    sn[v].append((u,b))
    sn[u].append((v,b))
#print(en)

import numpy as np
INF=10**20

def dijkstra(S, N, paths):
    from heapq import heappush,heappop
    q=[(0,S)]
    shortest=[INF]*N
    shortest[S]=0
    while len(q)>0:
        d0, src=heappop(q)
        if d0>shortest[src]:
            continue
        for dst, d1 in paths[src]:
            if d0+d1<shortest[dst]:
                shortest[dst]=d0+d1
                heappush(q, (d0+d1, dst))
    return np.array(shortest)
    
en=dijkstra(s,n+1,en)
sn=dijkstra(t,n+1,sn)

cost=[]
for i in range(1,n+1):
    cost.append(en[i]+sn[i])
cost=cost[::-1]
#print(cost)

ans=[]
mi=cost[0]
for i in range(n):
    ans.append(min(mi,cost[i]))
    mi=min(mi,cost[i])
ans=ans[::-1]
#print(ans)
for i in ans:
    print(10**15-i)
l=[]
while 1:
    n,k=map(int,raw_input().split())
    cnt+=1
    if n==k==0:
        break
    l.append(n+k)
    if cnt%5==0:
        print chr(l.index(max(l))+65),max(l)
        l=[]

### FIXED CODE ###

cnt=0
l=[]
while 1:
    n,k=map(int,raw_input().split())
    cnt+=1
    if n==k==0:
        break
    l.append(n+k)
    if cnt%5==0:
        print chr(l.index(max(l))+65),max(l)
        l=[]
def acinput():
    return list(map(int,input().split(" ")))


N,M=acinput()
a=[0]*(N+1)
for i in range(M):
    a[int(input())]=1


Mod=1000000007

def solve(x):
    global dp,M
    if dp[x]>=0:
        return dp[x]

    res=0
    zeroflg=True
    if  a[x-1]!=1:
        res+=solve(x-1)%Mod
        zeroflg=False
    if a[x-2]!=1:
        res+=solve(x-2)%Mod
        zeroflg=False
    
    if zeroflg:
        return 0
    dp[x]=res
    return res

dp=[-1]*(N+1)
dp[0]=1
dp[1]=1

print(solve(N)%Mod)


### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

def acinput():
    return list(map(int, input().split(" ")))


N, M = acinput()
a = [0]*(N+1)
for i in range(M):
    a[int(input())] = 1


Mod = 1000000007


def solve(x):
    global dp, Mod
    if dp[x] >= 0:
        return dp[x]

    if x < 0:
        return 0

    res = 0
    zeroflg = True

    if  a[x-2] != 1:
        res += solve(x-2) 
        zeroflg = False

    if a[x-1] != 1:
        res += solve(x-1)
        zeroflg = False

    if zeroflg:
        return 0
    dp[x] = res% Mod
    return res


dp = [-1]*(N+1)
dp[0] = 1
dp[1] = 1

print(solve(N) % Mod)


'''
5 1
1
'''
from collections import Counter
N, K = map(int, input().split())
A = list(map(int, input().split()))
dA = Counter(A)
if len(dA) - K <= 0:
  print(0)
  exit()
print(sum(sorted(dA.values())[:len(dA)-K])))

### FIXED CODE ###

from collections import Counter
N, K = map(int, input().split())
A = list(map(int, input().split()))
dA = Counter(A)
if len(dA) - K <= 0:
  print(0)
  exit()
print(sum(sorted(dA.values())[:len(dA)-K] ))
s = input()
m = int(s[5:7])
if m <=4:
  print("Heisei")
else:
  prit("TBD")

### FIXED CODE ###

s = input()
m = int(s[5:7])
if m <=4:
  print("Heisei")
else:
  print("TBD")
import numpy as np

N, M = list(map(int, input().split()))
s = [0]*M
c = [0]*M
check = 1
for i in range(M):
    s[i], c[i] = list(map(int, input().split()))
    if ((N > 2) & (s[i] == 1) & (c[i] == 0)):
        check = 0

if check == 0:
    print('-1')
else:
    max = 10 ** N - 1
    #print(max)

    smax = np.max(s)
    if smax != 1:
        min = 10 ** (smax - 1)
    else:
        min = 0
    #print(min)

    answer = -1

    for i in range(max, min-1, -1):
        flag = 1
        for j in range(M):
            if s[j] <= N:
                if int(str(i)[s[j]-1]) != c[j]:
                    flag = 0
        if flag == 1:
            answer = i
    print(answer)

### FIXED CODE ###

import numpy as np

N, M = list(map(int, input().split()))
s = [0]*M
c = [0]*M
check = 1
for i in range(M):
    s[i], c[i] = list(map(int, input().split()))
    if ((N > 2) & (s[i] == 1) & (c[i] == 0)):
        check = 0

if check == 0:
    print('-1')
else:
    if N > 1:
        max = 10 ** N - 1
        min = 10 ** (N - 1)
    else:
        max = 9
        min = 0

    answer = -1

    for i in range(max, min-1, -1):
        flag = 1
        for j in range(M):
            if s[j] <= N:
                if int(str(i)[s[j]-1]) != c[j]:
                    flag = 0
        if flag == 1:
            answer = i
    print(answer)
n = int(input())
list = []
c1,c2,c3,c4 = 0,0,0,0
for i in n:
  list.append(input())
for j in n:
  if list[j] == "AC":
    c1 = c1+1
  if list[j] == "WA":
    c2 = c2+1
  if list[j] == "TLE":
    c3 = c3+1
  if list[j] == "RE":
    c4 = c4+1
print(f"AC {c1}\nWA {c2}\nTLE {c3}\nRE {c4}")

### FIXED CODE ###

n = int(input())
list = []
c1,c2,c3,c4 = 0,0,0,0
for i in range(0,n):
  list.append(input())
for j in range(0,n):
  if list[j] == "AC":
    c1 = c1+1
  if list[j] == "WA":
    c2 = c2+1
  if list[j] == "TLE":
    c3 = c3+1
  if list[j] == "RE":
    c4 = c4+1
print("AC x {}\nWA x {}\nTLE x {}\nRE x {}".format(c1,c2,c3,c4))
n=input()
r=n[0::2].count("0")+n[1::2].count("1")
print(min(r,len(n-r))

### FIXED CODE ###

def main(n):
	r = 0
	f = n[0]
	if(f =="0"):
		# zero mode
		for i in range(1, len(n)):
			if(i % 2 == 0): # 偶
				# 1
				if(n[i]=="1"):
					r+=1
			else: # basic
				# 0
				if(n[i]=="0"):
					r+=1
	else:
		# one mode
		for i in range(1, len(n)):
			if(i % 2 == 0): # 偶
				# 1
				if(n[i]=="0"):
					r+=1
			else: # basic
				# 0
				if(n[i]=="1"):
					r+=1
	# sum(result)
	return r

print(main(input()))
#assert(1 == main("000"))
#assert(3 == main("10010010"))
#assert(0 == main("0"))
class BIT:
    def __init__(self, N):
        self.size = N
        self.tree = [0] * (N + 1)

    def sum(self, i):
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s

    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i

    def __str__(self):
        return "BIT: [{}]".format(
            ", ".join(str(self.sum(i + 1) - self.sum(i))
                      for i in range(self.size))
        )

    def bisect_left(self, r):
        bit = self.tree

        if r == 0:
            return 0

        l = 1 << (r.bit_length() - 1)
        if r == l:
            l //= 2

        k = l // 2
        while r - l >= 1:
            if bit[r] > bit[l]:
                l += max(1, k)
            else:
                r = l
                l //= 2
            k //= 2

        return r if bit[r] > bit[l] else l


N, *A = map(int, open(0))

memo = {a: i for i, a in enumerate(sorted(set(A)), 1)}
B = [memo[a] for a in A]
M = len(memo) + 10
bit = BIT(M)
for b in B:
    i = bit.bisect_left(b - 1)
    if i != 0:
        bit.add(i, -1)
    bit.add(b, 1)

print(bit.sum(M))


### FIXED CODE ###

from bisect import bisect_right

N = int(input())
A = [int(input()) for _ in range(N)]
A.reverse()

L = [A[0]]
for a in A[1:]:
    if a >= L[-1]:
        L.append(a)
    else:
        L[bisect_right(L, a)] = a

print(len(L))
X = input()
A = input()

if X < A:
    print('0')
else:
    print('10')

### FIXED CODE ###

X,A = map(int,input().split())

if X < A:
    print('0')
else:
    print('10')
import sys

def main(argv):
 #L = int(argv.pop())
 #tree = [int(s) for s in argv]
 n = int(argv[0])
 if n%2 == 0:
    print(n/2)
 else:
    print(int(n/2)+1)

if __name__ == '__main__':
    main(sys.argv[1:])


### FIXED CODE ###

s = input().strip()
s = int(s)

if s%2 == 0:
    print(int(s/2))
else:
    print(int(s/2)+1)
n,k = map(int, input().split(" "))
s = list(input())

if s[0] == "0":
    s_num = [0]
else:
    s_num = []
pre = s[0]
num = 0

for i in s:
    if pre == i:
        num += 1
    else:
        s_num.append(num)
        num = 1
        pre = "1" if pre == "0" else "0"
else:
    s_num.append(num)

sums = [s_num[0]]

for i,e in enumerate(s_num[1:]):
    sums.append(sums[i] + e)

ret = 0
sums_len = len(sums)-1
for i in range(len(s_num)//2+1,2):
    ret = max(ret,(sums[min(i+k*2+1,sums_len)] - sums[i]))
 
print(ret)

### FIXED CODE ###

n,k = map(int, input().split(" "))
s = list(input())

if s[0] == "0":
    s_num = [0]
else:
    s_num = []
pre = s[0]
num = 0

for i in s:
    if pre == i:
        num += 1
    else:
        s_num.append(num)
        num = 1
        pre = "1" if pre == "0" else "0"
else:
    s_num.append(num)

sums = [0]

for i,e in enumerate(s_num):
    sums.append(sums[i] + e)

ret = 0
sums_len = len(sums)-1
for i in range(0,len(sums),2):
    ret = max(ret,(sums[min(i+k*2+1,sums_len)] - sums[i]))
 
print(ret)
import math
n = int(input())
a = [0] * n;  b = [0] * n;
for i in range(n):
    a[i], b[i] = [int(x) for x in input().split()]
p = 10 ** 9 + 7

d = [0] * n
dict = {}
for i in range(n):
    d[i] = math.gcd(a[i], b[i])
    aa = a[i] // d[i]
    bb = b[i] // d[i]
    if aa < 0: # 非負数にする
        aa = -aa
        bb = -bb
    if (aa, bb) in dict:
        dict[(aa, bb)] += 1
    else:
        dict[(aa, bb)] = 1

bad = []
others = []
while dict:
    aa, bb = list(dict.keys())[0]
    if bb >= 0 and (bb, -aa) in dict:
        bad.append((dict[(aa, bb)], dict[(bb, -aa)]))
        del dict[(bb, -aa)]
    elif (-bb, aa) in dict:
        bad.append((dict[(aa, bb)], dict[(-bb, aa)]))
        del dict[(-bb, aa)]
    else:
        others.append(dict[(aa, bb)])
    del dict[(aa, bb)]

ans = 1
for (x, y) in bad:
    ans = ans * (pow(2, x, p) + pow(2, y, p) - 1) % p
for z in others:
    ans = ans * pow(2, z, p) % p
ans -= 1
print(ans)

### FIXED CODE ###

# WA
import math
n = int(input())
a = [0] * n;  b = [0] * n;
for i in range(n):
    a[i], b[i] = [int(x) for x in input().split()]
p = 10 ** 9 + 7

# d = [0] * n
dict = {}
for i in range(n):
    d = math.gcd(a[i], b[i])
    if d > 0:
        aa = a[i] // d
        bb = b[i] // d
    else:
        aa = a[i]
        bb = b[i]
    if aa < 0: # 非負数にする
        aa = -aa
        bb = -bb
    if aa == 0 and bb > 0:
        bb = -bb
    # print("aa, bb = {}, {}".format(aa, bb))
    if (aa, bb) in dict:
        dict[(aa, bb)] += 1
    else:
        dict[(aa, bb)] = 1

bad = []
others = []
zeros = 0

for (aa, bb) in dict:
    if dict[(aa, bb)] == 0: continue
    if aa == 0 and bb == 0:
        zeros += dict[(aa, bb)]
        dict[(aa, bb)] = 0
    elif (bb, -aa) in dict:
        bad.append((dict[(aa, bb)], dict[(bb, -aa)]))
        dict[(bb, -aa)] = 0
    elif (-bb, aa) in dict:
        bad.append((dict[(aa, bb)], dict[(-bb, aa)]))
        dict[(-bb, aa)] = 0
    else:
        others.append(dict[(aa, bb)])
    dict[(aa, bb)] = 0

ans = 1
for (x, y) in bad:
    ans = ans * (pow(2, x, p) + pow(2, y, p) - 1) % p
for z in others:
    ans = ans * pow(2, z, p) % p
ans = (ans - 1) % p
if zeros > 0:
    ans = (ans + zeros) % p
print(ans)
# # import math
N = int(input())
# # count = 0
# # flag = False
# # # n = int(math.sqrt(N))
n = 100

# # for i in range(1, N + 1):
    
# #     for j in range(1, n):
# #         for l in range(1, n):
# #             for r in range(1, n):
# #                 if j + l + r > N // 2:
# #                     continue
# #                 if j ** 2 + l ** 2 + r ** 2 + j * l + j * r + l * r == i:
# #                     if j == l == r:
# #                         flag = True
# #                         count = 1
# #                         break
# #                     else:
# #                         flag = True
# #                         count = 3
# #                         break
# #             if flag:
# #                 break
# #         if flag:
# #             break            
# #     print(count)
# #     count = 0
# #     flag = False
ans = [0] * 10000
for j in range(1, n):
    for l in range(1, n):
        for r in range(1, n):
            value = j * j  + l * l + r * r + j * l + j * r + l * r
            if value < 10000:
                ans[value] += 1

for i in range(N):
    print(ans[i + 1])
# n = int(input())
# ans = [0 for _ in range(10050)]
# for i in range(1,105):
#     for j in range(1,105):
#         for k in range(1,105):
#             v = i*i+j*j+k*k+i*j+j*k+k*i;
#             if v<10050:
#                 ans[v]+=1   
# for i in range(n):
#     print(ans[i+1])

### FIXED CODE ###

# # import math
N = int(input())
# # count = 0
# # flag = False
# # # n = int(math.sqrt(N))
n = 105

# # for i in range(1, N + 1):
    
# #     for j in range(1, n):
# #         for l in range(1, n):
# #             for r in range(1, n):
# #                 if j + l + r > N // 2:
# #                     continue
# #                 if j ** 2 + l ** 2 + r ** 2 + j * l + j * r + l * r == i:
# #                     if j == l == r:
# #                         flag = True
# #                         count = 1
# #                         break
# #                     else:
# #                         flag = True
# #                         count = 3
# #                         break
# #             if flag:
# #                 break
# #         if flag:
# #             break            
# #     print(count)
# #     count = 0
# #     flag = False
ans = [0] * 10050
for j in range(1, n):
    for l in range(1, n):
        for r in range(1, n):
            value = j * j  + l * l + r * r + j * l + j * r + l * r
            if value < 10050:
                ans[value] += 1

for i in range(N):
    print(ans[i + 1])
# n = int(input())
# ans = [0 for _ in range(10050)]
# for i in range(1,105):
#     for j in range(1,105):
#         for k in range(1,105):
#             v = i*i+j*j+k*k+i*j+j*k+k*i;
#             if v<10050:
#                 ans[v]+=1   
# for i in range(n):
#     print(ans[i+1])
n,m=map(int,input().split())
a=list(map(int,input().split()))
a_sort=a.sorted()
sum=0
for i in a:
  sum+=i

for j in (1,m+1):
 if j<=1/(4*m):
    print("No")
    exit()
print("Yes")


### FIXED CODE ###

n,m=map(int,input().split())
a=list(map(int,input().split()))
a_sort=[]
a_sort=sorted(a,reverse=True)
sum=0
for i in a:
  sum+=i
b_sort=a_sort[0:m]
for j in b_sort:
 if j<sum/(4*m):
    print("No")
    exit()
print("Yes")
while(1):
    try:
        N,M=map( int,raw_input().split())
        W=[[] for i in range(3)]
        for i in range(N):
            name=raw_input()
            inp=map( int,raw_input().split())
            c=inp[0]
            for i in range(3):
                W[i].append([c, inp[1+i]])

        ans=0
        for i in range(3):
            DP=[[0 for x in range(M+1)] for y in range(N)]

            for t in range(M):
                ci=W[i][0][0]*t
                if ci <= M:
                    DP[0][ci]=W[i][0][1]*t
                else:
                    break

            for y in range(1,N):
                for x in range(M+1):

                    for t in range(M):
                        ci=W[i][y][0]*t
                        if ci <= x:
                            DP[y][x] = max(DP[y][x], DP[y-1][x-ci]+W[i][y][1]*t )
                        else:
                            break
            ans=max(ans, max(DP[-1]))
        print ans
    except:
        break



### FIXED CODE ###

while(1):
    try:
        N,M=map( int,raw_input().split())
        W=[[] for i in range(3)]
        for i in range(N):
            name=raw_input()
            inp=map( int,raw_input().split())
            c=inp[0]
            for i in range(3):
                W[i].append([c, inp[1+i]])
        for i in range(3):
            W[i].sort(key = lambda x:x[0])
        ans=0
        for i in range(3):
            U=[0 for x in range(M+1)]
            V=[0 for x in range(M+1)]
            for y in range(N):
                for t in range(M+1):
                    ci=W[i][y][0]*t
                    if ci <= M:
                        U[ci]=max(U[ci], W[i][y][1]*t)
                    else:
                        break
            for j in range(M+1):
                for k in range(j+1):
                    V[j]=max(V[j], V[j-k]+U[k])
            ans=max(ans, V[-1])
        print ans
    except:
        break
from collections import deque
n,k=[int(i) for i in input().split()]
v=[int(i) for i in input().split()]
tmp=v.copy()
res=0
for right in range(k+1):
    for left in range(k-right+1):
        v=tmp.copy()
        ans=[]
        ans+=v[:right]
        ans+=v[n-left:]
        v=v[right:n-left]
        ans.sort()
        for i in range(min(k-right-left,len(ans))+1):
            res=max(res,sum(ans[i:]))
print(res)

### FIXED CODE ###

n,k=[int(i) for i in input().split()]
v=[int(i) for i in input().split()]
res=0
for right in range(k+1):
    for left in range(min(n,k)-right+1):
        ans=[]
        ans+=v[:right]
        ans+=v[n-left:]
        ans.sort()
        for i in range(min(k-right-left,len(ans))+1):
            res=max(res,sum(ans[i:]))
print(res)
print("YNeos"[notA%3==0orB%3==0or(A+B)%3==0::2])

### FIXED CODE ###

A, B = map(int, input().split())
if A%3==0 or B%3==0 or (A+B)%3==0:
  print("Possible")
else:
  print("Impossible")
n = int(input())
a = list(map(int, input().split()))

money = 1000
stock = 0
for i in range(n):
    money += stock * a[i]
    stock = 0

    if a[i] < a[i + 1]:
        stock = money // a[i]
        money %= a[i]

print(money)


### FIXED CODE ###

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

money = 1000
stock = 0
for i in range(n):
    # 売る
    money += stock * a[i]
    stock = 0

    # 買う
    if i != n - 1 and a[i] < a[i + 1]:
        stock = money // a[i]
        money %= a[i]

print(money)
a, b =map(int,input().split())
answer = 1
num = 0
while (answer < b) :
  anwer += a - 1
  num += 1
  
print(num)


### FIXED CODE ###

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

ans = 1
i = 0
while ans < B:
    ans += A - 1
    i += 1

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

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

A.sort()
S.sort(key=lambda x: x[1], reverse=True)

X = [0]*(len(A))
idx = 0

for i in range(M):
    if idx < len(A):
        X[idx:S[i][0]] = [S[i][1]] * S[i][0]
        idx += S[i][0]

for i in range(idx):
    A[i] = max(A[i], X[i])

print(sum(A))

### FIXED CODE ###

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

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

A.sort()
S.sort(key=lambda x: x[1], reverse=True)

idx = 0

for i in range(M):
    for j in range(idx, min(N, idx + S[i][0])):
        if A[j] < S[i][1]:
            A[j] = S[i][1]
            idx += 1
        else:
            break

print(sum(A))
a, b, h = map(int(input).sprit())

print((a + b) * h / 2)

### FIXED CODE ###

a,b,h=map(int,open(0))
 
print((a+b)*h//2)
N, W = map(int, input().split())
w = [0]*N
v = [0]*N
for i in range(N):
    w[i], v[i] = map(int, input().split())
vmax = max(v)
dp = [[0]*(N * vmax + 1) for i in range(N + 1)]
dp[0][0] = 0
for j in range(N * vmax):
    dp[0][j + 1] = float("inf")

for i in range(N):
    for j in range(N * vmax + 1):
        if j < v[i]:
            dp[i + 1][j] = dp[i][j]
        else: 
            dp[i + 1][j] = min(dp[i][j], dp[i][j - v[i]] + w[i])

ans = 0
for j in range(N*vmax):
    if dp[N][j] <= W:
        ans = j
print(ans

### FIXED CODE ###

N, W = map(int, input().split())
w = [0]*N
v = [0]*N
for i in range(N):
    w[i], v[i] = map(int, input().split())
vmax = max(v)
dp = [[0]*(N * vmax + 1) for i in range(N + 1)]
dp[0][0] = 0
for j in range(N * vmax):
    dp[0][j + 1] = float("inf")

for i in range(N):
    for j in range(N * vmax + 1):
        if j < v[i]:
            dp[i + 1][j] = dp[i][j]
        else: 
            dp[i + 1][j] = min(dp[i][j], dp[i][j - v[i]] + w[i])

ans = 0
for j in range(N * vmax + 1):
    if dp[N][j] <= W:
        ans = j
print(ans)
n, r = int(input())
k = 0
if(n<10):
    k=100*(10-n)
    print(k)
else:
    print(r)

### FIXED CODE ###

N, R = map(int, input().split())
if N < 10:
    print((100*(10-N))+R)
else:
    print(R)
a,b = map(int, input().split())

if a < b:
    ttt = a
else:
    ttt = b
    
num_list = [1]
for i in range(2,ttt+1):
    mod_a = a % i
    mod_b = b % i
    if mod_a == 0 and mod_b == 0:
        c.append(i)

import numpy as np
if sum(c) == 1:
    print(a*b)
else:
    print(np.prod(np.array(c)))

### FIXED CODE ###

import fractions
A, B = map(int, input().split())
print(A*B//fractions.gcd(A, B))
n = int(input())

tasks = []
for _ in range(n):
  a,b = list(map(int,input().split(" ")))
  tasks.append(a,b)

tasks = sorted(tasks,key = lambda x:x[1])

now_time = 0
flag = True
for a,b in tasks:
  if now_time + a > b:
    flag = False
    break
  now_time += a
if flag:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n = int(input())

tasks = []
for _ in range(n):
  a,b = list(map(int,input().split(" ")))
  tasks.append((a,b))

tasks = sorted(tasks,key = lambda x:x[1])

now_time = 0
flag = True
for a,b in tasks:
  if now_time + a > b:
    flag = False
    break
  now_time += a
if flag:
  print("Yes")
else:
  print("No")
def factorial_mod(a, M):
    ans = 1
    for i in range(a,1,-1):
        ans = (ans * i) % M
    return ans
def test(n, a, M):
    ans = 1
    for i in range(a):
        ans = (ans * (n-i)) % M
    return ans
def combination_mod(n,a,M):
    tmp = factorial_mod(a,M)
    tmp = pow(tmp, M-2, M)
    ans = test(n,a,M) * tmp % M
    return ans
def output(n,a,b):
    M = 10**9+7
    ans = (pow(2,n,M) - 1 - combination_mod(n,a,M) - combination_mod(n,b,M)) % M
    return ans
n, a, b = map(int, input().split())
print(output(a,b,c))

### FIXED CODE ###

def factorial_mod(a, M):
    # return a!(mod M)
    ans = 1
    for i in range(a,1,-1):
        ans = (ans * i) % M
    return ans
def test(n, a, M):
    # return (nCaの分子) % M
    ans = 1
    for i in range(a):
        ans = (ans * (n-i)) % M
    return ans
def combination_mod(n,a,M):
    # return nCa % M
    tmp = factorial_mod(a,M)
    tmp = pow(tmp, M-2, M)
    ans = test(n,a,M) * tmp % M
    return ans
def output(n,a,b):
    M = 10**9+7
    ans = (pow(2,n,M) - 1 - combination_mod(n,a,M) - combination_mod(n,b,M)) % M
    return ans
n, a, b = map(int, input().split())
print(output(n,a,b))
import sys
input=sys.stdin.readline

N,Q=map(int,input().split())
l=[[]*N for i in range(N)]
temp=[0]*N
ans=[0]*N

def dfs(i,value):
    ans[i]+=value
    for item in l[i]:
        dfs(item,value+temp[item])

for i in range(N-1):
    a,b=map(int,input().split())
    l[a-1].append(b-1)
    #l[b-1].append(a-1)


for i in range(Q):
    p,x=map(int,input().split())
    temp[p-1]+=x

dfs(0,temp[0])

print(*ans)


### FIXED CODE ###

# coding: utf-8
# Your code here!
#パクリゆるして
#グラフのようななにか

import sys
input=sys.stdin.readline
sys.setrecursionlimit(1000000)

from collections import deque


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

tree=[[]*(N+1) for i in range(N+1)]
point=[0]*(N+1)

for _ in range(N-1):
    a,b=map(int,input().split())
    tree[a].append(b)
    tree[b].append(a)
    
for _ in range(Q):
    p,x=map(int,input().split())
    point[p]+=x
#print(point)

d=deque([[1,0]])

while d:
    node,parent=d.popleft()
    point[node]+=point[parent]
    lis=tree[node]
    for child in lis:
        if child==parent:
            continue
        d.append([child,node])
    #print(d)

print(*point[1:])
import math

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

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

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

for i in range(1, K+1):
  print((combinations_count(N-K+1, i) * combinations_count(K-1, i-1)) % (10**9 + 7))

### FIXED CODE ###

import math

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

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

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

for i in range(1, K+1):
  if N - K + 1 < i:
    print(0)
  else:
    print((combinations_count(N-K+1, i) * combinations_count(K-1, i-1)) % (10**9 + 7))