Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n=int(input())

num,a,b=0,0,0

for i in range(n):
  t,x,y=map(int,input().split())
  num,a,b=abs(t-num),abs(x-a),abs(y-b)
  su=a+b
  if num<su:
    ans="No"
    break
  else:
    if num%su==0:
      ans="Yes"
    elif su==0 and num%2==0:
      ans="Yes"
    else:
      ans="No"
      
print(ans)

Fixed submission:
n=int(input())

num,a,b=0,0,0

for i in range(n):
  t,x,y=map(int,input().split())
  num,a,b=abs(t-num),abs(x-a),abs(y-b)
  su=a+b
  if num>=su and num%2 == su%2:
    ans="Yes"
  else:
    ans="No"
    break
      
print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())

num,a,b=0,0,0

for i in range(n):
  t,x,y=map(int,input().split())
  num,a,b=abs(t-num),abs(x-a),abs(y-b)
  su=a+b
  if num<su:
    ans="No"
    break
  else:
    if num%su==0:
      ans="Yes"
    else:
      ans="No"
      
print(ans)

Fixed submission:
n=int(input())

num,a,b=0,0,0

for i in range(n):
  t,x,y=map(int,input().split())
  num,a,b=abs(t-num),abs(x-a),abs(y-b)
  su=a+b
  if num>=su and num%2 == su%2:
    ans="Yes"
  else:
    ans="No"
    break
      
print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())

t,x,y=map(int,input().split())
num=x+y

if t%num!=0:
  print("No")
  exit()
if n==1:
  print("Yes")
  exit()

for i in range(n-1):
  t,x,y=map(int,input().split())
  num-=(x+y)
  num=abs(num)
  if t%num!=0:
    print("No")
    exit()
    
print("Yes")
  

Fixed submission:
n=int(input())

num,a,b=0,0,0

for i in range(n):
  t,x,y=map(int,input().split())
  num,a,b=abs(t-num),abs(x-a),abs(y-b)
  su=a+b
  if num>=su and num%2 == su%2:
    ans="Yes"
  else:
    ans="No"
    break
      
print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())

num=0

t,x,y=map(int,input().split())
num+=(x+y)
if t%num!=0:
  print("No")
  exit()
if n==1:
  print("Yes")
  
for i in range(n-1):
  t,x,y=map(int,input().split())
  num-=(x+y)
  num=abs(num)
  if t%num!=0:
    print("No")
    exit()
    
print("Yes")
  

Fixed submission:
n=int(input())

num,a,b=0,0,0

for i in range(n):
  t,x,y=map(int,input().split())
  num,a,b=abs(t-num),abs(x-a),abs(y-b)
  su=a+b
  if num>=su and num%2 == su%2:
    ans="Yes"
  else:
    ans="No"
    break
      
print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())

num=0

t,x,y=map(int,input().split())
num+=(x+y)
if t%num!=0:
  print("NO")
  exit()
  
for i in range(n-1):
  t,x,y=map(int,input().split())
  num-=(x+y)
  num=abs(num)
  if t%num!=0:
    print("NO")
    exit()
    
print("YES")
  

Fixed submission:
n=int(input())

num,a,b=0,0,0

for i in range(n):
  t,x,y=map(int,input().split())
  num,a,b=abs(t-num),abs(x-a),abs(y-b)
  su=a+b
  if num>=su and num%2 == su%2:
    ans="Yes"
  else:
    ans="No"
    break
      
print(ans)
Buggy python submission (verdict: Runtime Error):
s=str(input())
t=str(input())

l="abcdefghijklmnopqrstuvwxyz"

ss=''.join(sorted(s))
st=''.join(sorted(t))
str=''.join(sorted(t,reverse=True))

if l.index(str[1])>l.index(ss[1]):
  ans="Yes"
elif len(t)>len(s) and ss in st:
  ans="Yes"
else:
  ans="No"
  
print(ans)


Fixed submission:
s=str(input())
t=str(input())

l="abcdefghijklmnopqrstuvwxyz"

ss=''.join(sorted(s))
st=''.join(sorted(t))
str=''.join(sorted(t,reverse=True))

if l.index(str[0])>l.index(ss[0]):
  ans="Yes"
elif len(t)>len(s) and ss in st:
  ans="Yes"
else:
  ans="No"
  
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=list(map(int,input().split()))

ans=0
while True:
  for i in l:
    if i%2!=0:
      break
  ans+=1
  l=[i/2 for i in l]
  
print(ans)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))

ans=0
while True:
  for i in l:
    if i%2!=0:
      print(ans)
      exit()
  ans+=1
  l=[i/2 for i in l]
Buggy python submission (verdict: Runtime Error):
n=int(input())

if n==1:
  print(2)
elif n==2:
  print(1)
else:
  ans=0
  num_1=2
  num_2=1
  for i in range(n-1):
    ans = num_1+num_2
    num_1,num_2 = num_2, ans

print(ans)

Fixed submission:
n=int(input())

if n==1:
  print(1)
elif n==2:
  print(3)
else:
  ans=0
  num_1=2
  num_2=1
  for i in range(n-1):
    ans = num_1+num_2
    num_1,num_2 = num_2, ans
  print(ans)
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())

l=[list(input()) for i in range(h)]
ans=[[0]*w for i in range(h)]

for i in range(h):
  for j in range(w):
    if l[i][j]=="#":
      ans[i][j]=="#"
    else:
      for a in range(-1,2):
        for b in range(-1,2):
          if i+a<h and j+b<w ansl[i+a][j+b]=="#":
            ans[i][j]+=1
            
for i in range(h):
  print(*ans[i])


Fixed submission:
h,w=map(int,input().split())
l=[list(input()) for i in range(h)]

ans=[[0]*w for i in range(h)]

for i in range(h):
  for j in range(w):
    if l[i][j]=='#':
      ans[i][j]='#'
    else:
      for p in range(-1,2):
        for q in range(-1,2):
          if 0<=i+p<h and 0<=j+q<w and l[i+p][j+q]=='#':
            ans[i][j]+=1
            
for i in range(h):
  print(*ans[i],sep='')
Buggy python submission (verdict: Runtime Error):
import math

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

c_4=0
c_2=0

for i in l:
  if i%4==0:
    c_4+=1
  elif i%2==0:
    c_2+=1


if c_2==1:
  num=n
else:
  num=n-c_2  
  
if matj.ceil(num/2) <= c_4:
  ans="Yes"
elif c_2==n:
  ans="Yes"
else:
  ans="No"
  
print(ans)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))

c_4=0
even=0
odd=0

for i in l:
  if i%4==0:
    c_4+=1
  elif i%2==0:
    even+=1
  else:
    odd+=1
  
if even==0 and odd-1 <= c_4:
  ans="Yes"
else:
  ans="No"
  
if even>0 and odd <= c_4:
  ans="Yes"
else:
  "No"

print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=[int(input()) for i in range(n)]

l_5=[i for i in l if i%5==0 and i%10!=0]
l_10=[i for i in l if i%10==0]

sum_l=sum(l)

if sum_l%10!=0:
  print(sum_l)
else:
  if len(l_10)==n:
    print(0)
  else:
    print(sum_l-min(l_5))

Fixed submission:
n=int(input())
l=[int(input()) for i in range(n)]

lis=[i for i in l if i%10!=0]

sum_l=sum(l)

if sum_l%10!=0:
  print(sum_l)
else:
  if len(lis)==0:
    print(0)
  else:
    print(sum_l-min(lis))
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())

ans="No"
for i in range(1,b+1):
  for j in range(1,a+1):
    if a*i=b*j+c:
      ans="Yes"
      break
      
print(ans)

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

ans="NO"
for i in range(0,b+1):
  for j in range(0,a+1):
    if a*i == b*j+c:
      ans="YES"
      break
      
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))

if n=<2:
  print(1)
  exit()
  
cnt=0

if l[0]>l[1]:
  ans="low"
elif l[0]<l[1]:
  ans="high"
else:
  ans="even"
  
for i in range(2,n):
  if l[i-1]>l[i] and (ans=="low" or ans=="even"):
    ans="low"
  elif l[i-1]<l[i] and (ans=="high" or ans=="even"):
    ans="high"
  elif l[i-1]==l[i]:
    continue
  else:
    cnt+=1
    ans="even"
    
print(cnt+1)


Fixed submission:
n=int(input())
l=list(map(int,input().split()))

if n<=2:
  print(1)
  exit()
  
cnt=0

if l[0]>l[1]:
  ans="low"
elif l[0]<l[1]:
  ans="high"
else:
  ans="even"
  
for i in range(2,n):
  if l[i-1]>l[i] and (ans=="low" or ans=="even"):
    ans="low"
  elif l[i-1]<l[i] and (ans=="high" or ans=="even"):
    ans="high"
  elif l[i-1]==l[i]:
    continue
  else:
    cnt+=1
    ans="even"
    
print(cnt+1)

Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))

cnt=0

if l[0]>l[1]:
  ans="low"
elif l[0]<l[1]:
  ans="high"
else:
  ans="even"
  
for i in range(2,n):
  if l[i-1]>l[i] and (ans=="low" or ans=="even"):
    ans="low"
  elif l[i-1]<l[i] and (ans=="high" or ans=="even"):
    ans="high"
  elif l[i-1]==l[i]:
    ans="even"
  else:
    cnt+=1
    ans="even"
    
print(cnt+1)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))

if n<=2:
  print(1)
  exit()
  
cnt=0

if l[0]>l[1]:
  ans="low"
elif l[0]<l[1]:
  ans="high"
else:
  ans="even"
  
for i in range(2,n):
  if l[i-1]>l[i] and (ans=="low" or ans=="even"):
    ans="low"
  elif l[i-1]<l[i] and (ans=="high" or ans=="even"):
    ans="high"
  elif l[i-1]==l[i]:
    continue
  else:
    cnt+=1
    ans="even"
    
print(cnt+1)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())

a_lis=[list(map(int,input())) for i in range(n)]
c_lis=[list(map(int,input())) for i in range(m)]

for i in range(n):
  num=0
  ans=10**10
  for j in reversed(range(m)):
    a=a_lis[i]
    c=c_lis[j]
    num=abs(a[0]-c[0])+abs(a[1]-c[1])
    ans=min(ans,num)
    if num==ans:
      cnt=j+1
  print(cnt)
    

Fixed submission:
n,m=map(int,input().split())

a_lis=[list(map(int,input().split())) for i in range(n)]
c_lis=[list(map(int,input().split())) for i in range(m)]

for i in range(n):
  num=0
  ans=10**10
  for j in reversed(range(m)):
    a=a_lis[i]
    c=c_lis[j]
    num=abs(a[0]-c[0])+abs(a[1]-c[1])
    ans=min(ans,num)
    if num==ans:
      cnt=j+1
  print(cnt)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())

a_lis=[list(map(int,input().split())) for i in range(n)]
c_lis=[list(map(int,input().split())) for i in range(m)]

for i in range(n):
  num=0
  ans=10**8
  for j in reversed(range(m)):
    a=a_lis[i]
    c=c_lis[j]
    num=abs(a[0]-c[0])+abs(a[1]-c[1])
    ans=min(ans,num)
    if num==ans:
      cnt=j+1
  print(cnt)
    


Fixed submission:
n,m=map(int,input().split())

a_lis=[list(map(int,input().split())) for i in range(n)]
c_lis=[list(map(int,input().split())) for i in range(m)]

for i in range(n):
  num=0
  ans=10**10
  for j in reversed(range(m)):
    a=a_lis[i]
    c=c_lis[j]
    num=abs(a[0]-c[0])+abs(a[1]-c[1])
    ans=min(ans,num)
    if num==ans:
      cnt=j+1
  print(cnt)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())

a_lis=[list(map(int,input())) for i in range(n)]
c_lis=[list(map(int,input())) for i in range(m)]

for i in range(n):
  num=0
  ans=10**8
  for j in reversed(range(m)):
    a=a_lis[i]
    c=c_lis[j]
    num=abs(a[0]-c[0])+abs(a[1]-c[1])
    ans=min(ans,num)
    if num==ans:
      cnt=j+1
  print(cnt)
    

Fixed submission:
n,m=map(int,input().split())

a_lis=[list(map(int,input().split())) for i in range(n)]
c_lis=[list(map(int,input().split())) for i in range(m)]

for i in range(n):
  num=0
  ans=10**10
  for j in reversed(range(m)):
    a=a_lis[i]
    c=c_lis[j]
    num=abs(a[0]-c[0])+abs(a[1]-c[1])
    ans=min(ans,num)
    if num==ans:
      cnt=j+1
  print(cnt)
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
m=int(input())

sum_l=sum(l)

for i in range(m):
  p,x=map(int,input().split())
  ams=sum_l-l[p-1]+x
  print(ans)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
m=int(input())

sum_l=sum(l)

for i in range(m):
  p,x=map(int,input().split())
  ans=sum_l-l[p-1]+x
  print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a,b=map(int,input().split())

cnt=0
if (a>0 and b<0) or (a<0 and b>0):
  ans="Zero"
elif a==0 or b==0:
  ans="Zero"
elif a>0 and b>0:
  ans="Positive"
elif a<0 and b<0:
  a,b=a*-1,b*-1
  for i in range(b,a+1):
    cnt+=1
  if cnt%2==0:
    ans="Positive"
  else:
    ans="Negative"
    
print(ans)

Fixed submission:
a,b=map(int,input().split())

if (a>0 and b<0) or (a<0 and b>0):
  ans="Zero"
elif a==0 or b==0:
  ans="Zero"
elif a>0 and b>0:
  ans="Positive"
elif a<0 and b<0:
  if (a%2==0 and b%2==0) or (a%2!=0 and b%2!=0):
    ans="Negative"
  else:
    ans="Positive"
    
print(ans)
Buggy python submission (verdict: Runtime Error):

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

if 9<A || 9<B:
  print(-1)
else:
  print(A*B)
  

Fixed submission:
A,B = list(map(int, input().split()))

if (9<A or 9<B):
  print(-1)
else:
  print(A*B)
Buggy python submission (verdict: Runtime Error):
N, D = map(int, input().split())
 
result = -(-N // (2D+1))
 
print(result)

Fixed submission:
N, D = map(int, input().split())
 
result = -(-N // (2*D+1))
 
print(result)

Buggy python submission (verdict: Runtime Error):
N, D = map(int, input().split())

result = N // (2D+1) + 1

print(result)

Fixed submission:
N, D = map(int, input().split())
 
result = -(-N // (2*D+1))
 
print(result)
Buggy python submission (verdict: Runtime Error):
N,L=map(int, input().split())
 
sum = 0
lower = 100
for i in range(1, N+1):
    sum = sum + L + i -1
for i in range(1, N+1):
    s = abs(L + i -1)
    if s < lower:
        lower = s
        ij = i
 
print(sum - (L + ij -1))

Fixed submission:
S = list(input())
S.append("%")
a=0
for i in range(4):
    if ( S[i] == S[i+1]):
        a =1

if a == 1:
    print("Bad")
else:
    print("Good")
Buggy python submission (verdict: Runtime Error):
N,L=map(int, input().split())
 
sum = 0
lower = 100
for i in range(1, N+1):
    sum = sum + L + i -1
for i in range(1, N+1):
    s = abs(L + i -1)
    if s < lower:
        lower = s
        ij = i
 
print(sum - (L + ij -1))

Fixed submission:
N,L=map(int, input().split())
 
sum = 0
lower = 100000
for i in range(1, N+1):
    sum = sum + L + i -1
for i in range(1, N+1):
    s = abs(L + i -1)
    if s < lower:
        lower = s
        ij = i
 
print(sum - (L + ij -1))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = 1000

sell = []

for i in range(1, n):
    if a[i - 1] < a[i]:
        sell.append(i)

for i in range(len(sell)):
    if i == 0:
        l = 0
    else:
        l = sell[i - 1] + 1
    r = sell[i] - 1
    stock = ans // min(a[l:r + 1])
    ans += (a[sell[i]] - min(a[l:r + 1])) * stock

print(ans)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = 1000

for i in range(1, n):
    stock = 0
    if a[i - 1] < a[i]:
        stock = ans // a[i - 1]
    ans += (a[i] - a[i - 1]) * stock

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for _ in range(n):
    s = input()
    if s == "AC":
        ac += 1
    elif s == "WA":
        wa += 1
    elif s == "TLE":
        tle += 1
    elif sv == "RE":
        re += 1

print("AC x", ac)
print("WA x", wa)
print("TLE x", tle)
print("RE x", re)


Fixed submission:
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for _ in range(n):
    s = input()
    if s == "AC":
        ac += 1
    elif s == "WA":
        wa += 1
    elif s == "TLE":
        tle += 1
    elif s == "RE":
        re += 1

print("AC x", ac)
print("WA x", wa)
print("TLE x", tle)
print("RE x", re)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = sorted(list(map(int, ipupt().split())))
print(sum(p[:k]))


Fixed submission:
n, k = map(int, input().split())
print(sum(sorted(list(map(int, input().split())))[:k]))

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
print(sum(sorted(list(map(int, ipupt().split())))[:k]))


Fixed submission:
n, k = map(int, input().split())
print(sum(sorted(list(map(int, input().split())))[:k]))
Buggy python submission (verdict: Runtime Error):
def f(x):
    for a in range(-100, 101):
        for b in range(-100, 101):
            if a ** 5 - b ** 5 == x:
                A = [a, b]
                return A
B = f(int(input()))
print(B[0], B[1])


Fixed submission:
x = int(input())
for a in range(-118, 120):
    for b in range(-118, 120):
        if a**5 - b**5 == x:
            A = a
            B = b
print(A, B)

Buggy python submission (verdict: Runtime Error):
def f(x):
    for a in range(-100, 101):
        for b in range(-100, 101):
            if a ** 5 - b ** 5 == x:
                A = [a, b]
                return A
A = f(int(input()))
print(A[0], A[1])


Fixed submission:
x = int(input())
for a in range(-118, 120):
    for b in range(-118, 120):
        if a**5 - b**5 == x:
            A = a
            B = b
print(A, B)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = (input() for _ in range(n))
print(len(s))


Fixed submission:
n = int(input())
s = [input() for _ in range(n)]
print(len(set(s)))
Buggy python submission (verdict: Time Limit Exceeded):
import math
k = int(input())
ans = 0
for a in range(1, k + 1):
    for b in range(1, k + 1):
        for c in range(1, k + 1):
            ans += math.gcd(a, math.gcd(b, c))
print(ans)


Fixed submission:
import math
k = int(input())
dp = [[1 for _ in range(k + 1)] for _ in range(k + 1)]
for i in range(1, k + 1):
    for j in range(1, k + 1):
        dp[i][j] = math.gcd(i, j)
ans = 0
for a in range(1, k + 1):
    for b in range(1, k + 1):
        for c in range(1, k + 1):
            ans += dp[a][dp[b][c]]
print(ans)
Buggy python submission (verdict: Runtime Error):
x, y, z = map(int, input())
print(z, x, y)


Fixed submission:
x, y, z = map(int, input().split())
print(z, x, y)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)
s = 0
for i in set(a):
    s += c[i] * (c[i] - 1)
dp = [-1] * n
for i in a:
    if dp[i] == -1:
        dp[i] = (s - c[i] * (c[i] - 1) + (c[i] - 1) * (c[i] - 2)) // 2
        print(dp[i])
    else:
        print(dp[i])

Fixed submission:
import collections
n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
s = 0
for i in set(a):
    s += c[i] * (c[i] - 1)
for i in a:
    print(int((s - (c[i] * (c[i] - 1)) + ((c[i] - 1) * (c[i] - 2))) / 2))
Buggy python submission (verdict: Runtime Error):
h, w = map(int, input().split())

if h == 1 or w == 1:
    c == 1
elif h & 1:
    if w & 1:
        c = ((h + 1) // 2) * ((w + 1) // 2) + (h // 2) * (w // 2)
    else:
        c = (((h + 1) // 2) + (h // 2)) * (w // 2)
else:
    c = (h // 2) * w

print(c)


Fixed submission:
h, w = map(int, input().split())

if h == 1 or w == 1:
    c = 1
elif h & 1:
    if w & 1:
        c = ((h + 1) // 2) * ((w + 1) // 2) + (h // 2) * (w // 2)
    else:
        c = (((h + 1) // 2) + (h // 2)) * (w // 2)
else:
    c = (h // 2) * w

print(c)
Buggy python submission (verdict: Time Limit Exceeded):
def cmb(n, r, p):
    r = min(n, n - r)
    upper = 1
    for i in range(n, n - r, -1):
        upper = (upper * i) % p

    lower = 1
    for i in range(1, r + 1):
        lower = (lower * i) % p

    return (upper * pow(lower, p - 2, p)) % p

mod = pow(10, 9) + 7
n, a, b = map(int, input().split())
ans = (pow(2, n, mod) - 1 - cmb(n, a, mod) - cmb(n, b, mod)) % mod
print(ans)

Fixed submission:
MOD = pow(10, 9) + 7

def modinv(a, mod):
    return pow(a, mod - 2, mod) % mod

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

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

ans = (pow(2, n, MOD) - 1 - comb(n, a, MOD) - comb(n, b, MOD)) % MOD

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
MOD = 10**9 + 7

def modinv(a, mod = 10**9 + 7):
    return pow(a, mod - 2, mod)

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

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

ans = pow(2, n, MOD) - 1 - comb(n, a, MOD) - comb(n, b, MOD)

print(ans)


Fixed submission:
MOD = pow(10, 9) + 7

def modinv(a, mod):
    return pow(a, mod - 2, mod) % mod

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

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

ans = (pow(2, n, MOD) - 1 - comb(n, a, MOD) - comb(n, b, MOD)) % MOD

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from scipy.misc import comb
n, a, b = map(int, input().split())
l = [comb(n, k, exact = True) % (10**9 + 7) for k in range(1, n + 1)]
ans = 0
for i in range(n):
    if i != a - 1 and i != b - 1:
        ans += l[i]
print(ans)


Fixed submission:
MOD = pow(10, 9) + 7

def modinv(a, mod):
    return pow(a, mod - 2, mod) % mod

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

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

ans = (pow(2, n, MOD) - 1 - comb(n, a, MOD) - comb(n, b, MOD)) % MOD

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from scipy.misc import comb
n, a, b = map(int, input().split())
ans = 1
if n % 2 == 0:
    nn = n
else:
    nn = n + 1
for k in range(1, nn // 2):
    ans += 2 * comb(n, k, exact = True)
if n % 2 == 0:
    ans += comb(n, n // 2, exact = True)
ans -= comb(n, a, exact = True) + comb(n, b, exact = True)
print(ans % (10**9 + 7))

Fixed submission:
MOD = pow(10, 9) + 7

def modinv(a, mod):
    return pow(a, mod - 2, mod) % mod

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

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

ans = (pow(2, n, MOD) - 1 - comb(n, a, MOD) - comb(n, b, MOD)) % MOD

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = [input() for i in range(n)]
s.sort()
ans = []
c = 1
max = 0
for i in range(1, n):
    if s[i - 1] == s[i]:
        c += 1
    else:
        if c == max:
            ans.append(s[i - 1])
        elif c > max:
            ans.clear()
            ans.append(s[i - 1])
            max = c
        c = 1
if c == max:
    ans.append(s[-1])
elif c > max:
    ans.clear()
    ans.append(s[n - 1])
for des in ans:
    print(des)

Fixed submission:
n = int(input())
s = [input() for i in range(n)]
s.sort()
ans = []
c = 1
max = 0
for i in range(1, n):
    if s[i - 1] == s[i]:
        c += 1
    else:
        if c == max:
            ans.append(s[i - 1])
        elif c > max:
            ans.clear()
            ans.append(s[i - 1])
            max = c
        c = 1
if c == max:
    ans.append(s[-1])
elif c > max:
    ans.clear()
    ans.append(s[n - 1])
for des in ans:
    print(des)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
E = list(map(lambda x: (x + 1) * 0.5, list(map(int, input().split()))))
ans = sum(E[:k])
for i in range(1, n - k + 1):
    ans = max(ans, sum(E[i:i + k]))
print(ans)


Fixed submission:
n, k = map(int, input().split(" "))
p = list(map(int, input().split(" ")))
e = [(1 + p[i]) * 0.5 for i in range(n)]
s = 0.0
for i in e[:k]:
    s += i
t = s
for i in range(n - k):
    t = t - e[i] + e[k + i]
    s = max(s, t)
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split(" "))
p = list(map(int, input().split(" ")))
e = [0.0] * n
for i in range(n):
    e[i] = (1 + p[i]) * 0.5
s = 0.0
for i in range(k, n + 1):
    t = sum(e[i - k:i])
    if s < t:
        s = t
print(s)


Fixed submission:
n, k = map(int, input().split(" "))
p = list(map(int, input().split(" ")))
e = [(1 + p[i]) * 0.5 for i in range(n)]
s = 0.0
for i in e[:k]:
    s += i
t = s
for i in range(n - k):
    t = t - e[i] + e[k + i]
    s = max(s, t)
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split(" "))
p = list(map(int, input().split(" ")))
e = [0.0] * n
for i in range(n):
    e[i] = (1 + p[i]) * 0.5
s = 0.0
for i in range(k, n + 1):
    s = max(s, sum(e[i - k:i]))
print(s)

Fixed submission:
n, k = map(int, input().split(" "))
p = list(map(int, input().split(" ")))
e = [(1 + p[i]) * 0.5 for i in range(n)]
s = 0.0
for i in e[:k]:
    s += i
t = s
for i in range(n - k):
    t = t - e[i] + e[k + i]
    s = max(s, t)
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split(" "))
p = list(map(int, input().split(" ")))
e = [0.0] * n
for i in range(n):
    e[i] = (1 + p[i]) * 0.5
s = [0.0] * (n - k + 1)
for i in range(n - k + 1):
    for j in range(k):
        s[i] += e[i + j]
print(max(s))


Fixed submission:
n, k = map(int, input().split(" "))
p = list(map(int, input().split(" ")))
e = [(1 + p[i]) * 0.5 for i in range(n)]
s = 0.0
for i in e[:k]:
    s += i
t = s
for i in range(n - k):
    t = t - e[i] + e[k + i]
    s = max(s, t)
print(s)