Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
print(input().split().find('0')+1)

Fixed submission:
print(input().split().index('0')+1)
Buggy python submission (verdict: Runtime Error):
n = input()
if n[-1] == '3':
  print('bon')
if n[-1] in ['0', '1', '6', '8']:
  print('pon'):
else:
  print('hon')

Fixed submission:
n = int(input())
if n%10 == 3:
  print('bon')
elif n%10 in [0, 1, 6, 8]:
  print('pon')
else:
  print('hon')
Buggy python submission (verdict: Runtime Error):
i=input()
s=i()
t=i()
print(["No","Yes"][t[:-1]==s])

Fixed submission:
s=input()
t=input()
print(["No","Yes"][t[:-1]==s])
Buggy python submission (verdict: Runtime Error):
k=int(input())
a,b=map(int, input().split())
ok=False
for i in range(a, b+1):
  ok = ok or i % k
print(['NG','OK'][ok])

Fixed submission:
k=int(input())
a,b=map(int, input().split())
ok=False
for i in range(a, b+1):
  ok = ok or (i % k == 0)
print(['NG','OK'][ok])
Buggy python submission (verdict: Time Limit Exceeded):
import bisect


def count(text, s, rgb_bag):
    ans = 0
    for i in rgb_bag[text[0]]:
        for j in rgb_bag[text[1]]:
            if i > j:
                continue
            k = bisect.bisect_left(rgb_bag[text[2]], j)
            ans += len(rgb_bag[text[2]]) - k
            ng_idx = j + (j - i)
            if ng_idx >= len(s):
                continue
            if s[ng_idx] == text[2]:
                ans -= 1
    return ans


def main():
    n = int(input())
    s = input()
    rgb_bag = {'R': [], 'G': [], 'B': []}
    for i, v in enumerate(s):
        rgb_bag[v].append(i)
    ans = 0

    for r in 'RGB':
        for g in 'RGB':
            for b in 'RGB':
                if r == g or g == b or b == r:
                    continue
                ans += count(r+g+b, s, rgb_bag)
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
import bisect


def count(text, s, rgb_bag):
    ans = 0
    for i in rgb_bag[text[0]]:
        for j in rgb_bag[text[1]]:
            if i > j:
                continue
            k = bisect.bisect_left(rgb_bag[text[2]], j)
            ans += len(rgb_bag[text[2]]) - k
            ng_idx = j + (j - i)
            if ng_idx >= len(s):
                continue
            if s[ng_idx] == text[2]:
                ans -= 1
    return ans


def main():
    n = int(input())
    s = input()
    rgb_bag = {'R': [], 'G': [], 'B': []}
    for i, v in enumerate(s):
        rgb_bag[v].append(i)
    ans = 0

    for r in 'RGB':
        for g in 'RGB':
            for b in 'RGB':
                if r == g or g == b or b == r:
                    continue
                ans += count(r+g+b, s, rgb_bag)
    print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
    d='SUN,MON,TUE,WED,THU,FRI,SAT'.split(',')
    s=input()
    print(7 - d.index(s))

Fixed submission:
d='SUN,MON,TUE,WED,THU,FRI,SAT'.split(',')
s=input()
print(7 - d.index(s))

Buggy python submission (verdict: Runtime Error):
d='SUN,MON,TUE,WED,THU,FRI,SAT'.split(',')
s=input()
print(7 - d.find(s))

Fixed submission:
d='SUN,MON,TUE,WED,THU,FRI,SAT'.split(',')
s=input()
print(7 - d.index(s))
Buggy python submission (verdict: Runtime Error):
package main

import (
	"fmt"
	"sort"
	"strconv"
)

type Restaurant struct {
	S string
	P int
	Idx int
}

func solve() {
	var ts string
	var N int
	fmt.Scan(&N)

	var restaurants []Restaurant
	for i := 0; i < N; i++ {
		var s string
		fmt.Scan(&s, &ts)
		p, _ := strconv.Atoi(s)
		restaurants = append(restaurants, Restaurant{s, p, i+1})
	}
	sort.SliceStable(restaurants, func(i, j int) bool {
		if restaurants[i].S != restaurants[j].S {
			return restaurants[i].S < restaurants[j].S
		}
		return restaurants[i].P > restaurants[j].P
	})
	for _, r := range restaurants {
		println(r.Idx)
	}
}

func main() {
	solve()
}


Fixed submission:
def main():
    N = int(input())
    data = []
    for i in range(N):
        s, p = input().split()

        data.append((s, 100 - int(p), i+1))

    for s, p, i in sorted(data):
        print(i)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
s = input()

if s == "RRR":
  print(3)
elif s == "RRS" or s == "SRR":
  print(2)
elif s = "SSS":
  print(0)
else:
  print(1)

Fixed submission:
s = input()

if s == "RRR":
  print(3)
elif s == "SRR" or s == "RRS":
  print(2)
elif s == "SSS":
  print(0)
else:
  print(1)

Buggy python submission (verdict: Runtime Error):
s = intput()
if s == "RRR":
  print(3)

elif s == "SRR" or s == "RSS":
  print(2)
elif s = "SSS":
  print(0)
else:
  print(1)

Fixed submission:
s = input()

if s == "RRR":
  print(3)
elif s == "SRR" or s == "RRS":
  print(2)
elif s == "SSS":
  print(0)
else:
  print(1)
Buggy python submission (verdict: Runtime Error):
N = int.input()
if N % 1000 == 0:
  print(0)
else:
  print(1000-(N%1000))



Fixed submission:
N = int(input())
if N % 1000 == 0:
  print(0)
else:
  print(1000-(N%1000))

Buggy python submission (verdict: Runtime Error):
N = int.input()
oturi = 1000-(N%1000)
print(oturi)


Fixed submission:
N = int(input())
if N % 1000 == 0:
  print(0)
else:
  print(1000-(N%1000))

Buggy python submission (verdict: Runtime Error):
N = int.input()
oturi = N%1000
print(oturi)

Fixed submission:
N = int(input())
if N % 1000 == 0:
  print(0)
else:
  print(1000-(N%1000))
Buggy python submission (verdict: Runtime Error):
ab= int,input().split()
print(ab[0]*ab[1])


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

Buggy python submission (verdict: Runtime Error):
a,b = int,input().split()
print(a*b)

Fixed submission:
a, b = map(int, input().split())
print(a * b)
Buggy python submission (verdict: Runtime Error):
a = input()
if a[2]=="0" or a[2]=="1" or a[2]=="6" or a[2]=="8":
  print("pon")
elif a[2]=="3":
  print("bon")
else:
  print("hon")

Fixed submission:
a = int(input())
a %= 10

if a==0 or a==1 or a==6 or a==8:
  print("pon")
elif a==3:
  print("bon")
else:
  print("hon")

Buggy python submission (verdict: Runtime Error):
a = input()
if a[2]=="2" or a[2] =="4" or a[2] =="5" or a[2] =="7" or a[2] =="9":
  print("hon")
elif a[2] =="3":
  print("bon")
else:
  print("pon")

Fixed submission:
a = int(input())
a %= 10

if a==0 or a==1 or a==6 or a==8:
  print("pon")
elif a==3:
  print("bon")
else:
  print("hon")
Buggy python submission (verdict: Runtime Error):
import math
A,B,H,M=map(int,input().split())
thetaA=(360*H/12)%360
thetaB=(360*M/60)%360
if theraA-thetaB<=180:
  theta=theraA-thetaB
else:
  theta=360-theraA-thetaB
print(A*B*math.cos(math.radians(theta)))


Fixed submission:
import math
A,B,H,M=map(int,input().split())
thetaA=360/12*H+360/12*M/60
thetaB=360/60*M
theta=thetaA-thetaB
print(math.sqrt(A*A+B*B-2*A*B*math.cos(math.radians(theta))))

Buggy python submission (verdict: Runtime Error):
import math
A,B,H,M=map(float().split())
thetaA=(360*H/12)%360
thetaB=(360*M/60)%360
if theraA-thetaB<=180:
  theta=theraA-thetaB
else:
  theta=360-theraA-thetaB
print(A*B*math.cos(math.radians(theta)))


Fixed submission:
import math
A,B,H,M=map(int,input().split())
thetaA=360/12*H+360/12*M/60
thetaB=360/60*M
theta=thetaA-thetaB
print(math.sqrt(A*A+B*B-2*A*B*math.cos(math.radians(theta))))

Buggy python submission (verdict: Runtime Error):
import math
A,B,H,M=map(int().split())
thetaA=(2*360*H/12)%360
thetaB=(2*360*M/60)%360
if theraA-thetaB<=180:
  theta=theraA-thetaB
else:
  theta=360-theraA-thetaB
print(A*B*math.cos(math.radians(theta)))

Fixed submission:
import math
A,B,H,M=map(int,input().split())
thetaA=360/12*H+360/12*M/60
thetaB=360/60*M
theta=thetaA-thetaB
print(math.sqrt(A*A+B*B-2*A*B*math.cos(math.radians(theta))))
Buggy python submission (verdict: Runtime Error):
s=input()
if s.count('R')==1: print(1)
elif s.count('R')==3: print(3)
else:
    if s="RSR": print(1)
    else: print(2)


Fixed submission:
s=input().split('S')
if s.count('RRR'): print(3)
elif s.count('RR'): print(2)
elif s.count('R'): print(1)
else: print(0)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
if n%2==0: print(-1)
else:
    i=1
    x=7
    while x%n!=0:
        x*=10
        x+=7
        i+=1
    print(i)


Fixed submission:
k=int(input())
if (k%2)*(k%5)==0: print(-1)
else:
    i=1
    x=7
    while x%k:
        x=(x*10+7)%k
        i+=1
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
import os
import sys
from io import BytesIO, IOBase
from collections import defaultdict as dd

def main():
    n,k=map(int,input().split())
    ar=list(map(int,input().split()))
    prod=1
    for i in range(k):
        prod*=ar[i]
    for i in range(k,n):
        x=prod*ar[i]//ar[i-k]
        if x>prod:
            print('Yes')
        else:
            print('No')
        prod=x




BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")


if __name__ == "__main__":
    main()



Fixed submission:
from math import log2
n,k=map(int,input().split())
ar=list(map(int,input().split()))
for i in range(n):
    ar[i]=log2(ar[i])
prod=0
for i in range(k):
    prod+=ar[i]
for i in range(k,n):
    x=prod+ar[i]-ar[i-k]
    if x>prod:
        print('Yes')
    else:
        print('No')
    prod=x

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
ar=list(map(int,input().split()))
prod=1
for i in range(k):
    prod*=ar[i]
for i in range(k,n):
    x=prod*ar[i]//ar[i-k]
    if x>prod:
        print('Yes')
    else:
        print('No')
    prod=x



Fixed submission:
from math import log2
n,k=map(int,input().split())
ar=list(map(int,input().split()))
for i in range(n):
    ar[i]=log2(ar[i])
prod=0
for i in range(k):
    prod+=ar[i]
for i in range(k,n):
    x=prod+ar[i]-ar[i-k]
    if x>prod:
        print('Yes')
    else:
        print('No')
    prod=x
Buggy python submission (verdict: Runtime Error):
ans=0
n,s=map(int,input().split())
ar=list(map(int,input().split()))
mod=998244353

def func(b,sel,pos):
    global ans
    if b==s:
        ans+=pow(2,(n-sel),mod)
    #print(b,sel,pos,ans)
    if pos<n-1:
        func(b+ar[pos+1],sel+1,pos+1)
        if b<s:
            func(b,sel,pos+1)
    

func(ar[0],1,0)
func(0,0,0)
print(ans%mod)


Fixed submission:
mod=998244353
n,s=map(int,input().split())
ar=list(map(int,input().split()))
dp=[0 for y in range(s+1)]
dp[0]=1
for i in range(n):
    for j in range(s,-1,-1):
        if j+ar[i]<=s:
            dp[j+ar[i]]=(dp[j]+dp[j+ar[i]])%mod
        dp[j]=(dp[j]*2)%mod
print(dp[s])

Buggy python submission (verdict: Runtime Error):
ans=0
n,s=map(int,input().split())
ar=list(map(int,input().split()))

def func(b,sel,pos):
    global ans
    if b==s:
        ans+=1<<(n-sel)
    #print(b,sel,pos,ans)
    if pos<n-1:
        func(b+ar[pos+1],sel+1,pos+1)
        if b<s:
            func(b,sel,pos+1)
    

func(ar[0],1,0)
func(0,0,0)
print(ans)


Fixed submission:
mod=998244353
n,s=map(int,input().split())
ar=list(map(int,input().split()))
dp=[0 for y in range(s+1)]
dp[0]=1
for i in range(n):
    for j in range(s,-1,-1):
        if j+ar[i]<=s:
            dp[j+ar[i]]=(dp[j]+dp[j+ar[i]])%mod
        dp[j]=(dp[j]*2)%mod
print(dp[s])
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
dp=[0]*(k+1)
mod=int(1e9+7)
for i in range(k,0,-1):
    sm=0
    for j in range(2*i,k+1,i):
        sm=(sm+dp[j])%mod
    dp[i]=pow(k//i,n,mod)-sm

ans=0
for i in range(1,n+1):
    ans+=(dp[i]%mod*i%mod)%mod
print(ans%mod)


Fixed submission:
n,k=map(int,input().split())
dp=[0]*(k+1)
mod=int(1e9+7)
for i in range(k,0,-1):
    sm=0
    for j in range(2*i,k+1,i):
        sm=(sm+dp[j])%mod
    dp[i]=(pow(k//i,n,mod)-sm)%mod

ans=0
for i in range(1,k+1):
    ans+=(dp[i]%mod*i%mod)%mod
print(ans%mod)

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
dp=[0]*(k+1)
mod=int(1e9+7)
for i in range(k,0,-1):
    sm=0
    for j in range(2*i,k+1,i):
        sm=(sm+dp[j])%mod
    dp[i]=pow(k//i,n,mod)-sm

ans=0
for i in range(1,n+1):
    ans+=(dp[i]%mod*i%mod)%mod
print(ans%mod)


Fixed submission:
n,k=map(int,input().split())
dp=[0]*(k+1)
mod=int(1e9+7)
for i in range(k,0,-1):
    sm=0
    for j in range(2*i,k+1,i):
        sm=(sm+dp[j])%mod
    dp[i]=(pow(k//i,n,mod)-sm)%mod

ans=0
for i in range(1,k+1):
    ans+=(dp[i]%mod*i%mod)%mod
print(ans%mod)
Buggy python submission (verdict: Runtime Error):
x=int(input())
print(int(math.ceil(360/x)))

Fixed submission:
from math import *
from copy import *
from string import *				# alpha = ascii_lowercase
from random import *
from sys import stdin,stdout
from sys import maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *
from collections import Counter		# d = dict(Counter(l))
import math
import math
import time
from queue import Queue
# PradeepGhosh_2017076

def seive(n):
	l=[True]
	l=l*(n+1)
	for i in range(2,int(sqrt(n))+1):
		if(l[i]==True):
			val=i*i
			while(val<len(l)):
				l[val]=False
				val+=i
	prime=[]
	for i in range(2,len(l)):
		if(l[i]==True):
			prime.append(i)
	return prime

def dp(l,i,n,val,ans):
	if(i>=n or val<0):
		return 1000000
	elif(val==0):
		return 0
	else:
		if(ans[i]==1000000):
			ans[i]=min(min(1+dp(l,i+1,n,val-l[i],ans),1+dp(l,i,n,val-l[i],ans)),dp(l,i+1,n,val,ans))
		return ans[i]
from queue import Queue
def factors(n):
	l=[]
	for i in range(1,int(sqrt(n))+1):
		if(n%i==0):
			if(n//i==i):
				l.append(i)
			else:
				l.append(i)
				l.append(n//i)
	return l
def check1(s,v,x):
	while(True):
		if(v not in s):
			return v
		else:
			v-=1
def check2(s,v,x):
	while(True):
		if(v not in s):
			return v
		else:
			v+=1

if __name__ == '__main__':
	# l=seive(1000000)
	# s=set(l)
	# t=int(input())
	# for i in range(t):
	# 	n=int(input())
	# 	if(n==2):
	# 		print(1)
	# 	else:
	# 		if(n in s):
	# 			n=n-1
	# 		j=n-1
	# 		while(j>0):
	# 			if(n%j==0):
	# 				break
	# 			j-=1
	# 		print(j)
	x=int(input())
	c=0
	ans=0
	while(ans!=360):
		ans+=x
		if(ans>360):
			ans-=360
		c+=1
	print(c)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
val=4*m
c=0
for i in range(n):
  v=int(input())
  v=v/val
  if(v<m):
    c=c+0
  else:
    c=c+1
if(c>=m):
  print("YES")
else:
  print("NO")

Fixed submission:
n,m = input().split()
N = int(n)
M = int(m)
a = [int(i) for i in input().split()]
a.sort(reverse=True)
k = sum(a)/(4*M)
if k > a[M-1]:
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
n = input()
n = int(n)
l=[]
l=input().split(" ")
maximum=l[0]
c=1
for i in range(1,n):
	if(l[i]>=maximum):
		maximum=l[i]
		c=c+1
print(c)

Fixed submission:
n = input()
n = int(n)
l=[i for i in map(int,input().split())]
maximum=l[0]
c=0
for i in range(n):
	if(l[i]>=maximum):
		maximum=l[i]
		c=c+1
print(c)
Buggy python submission (verdict: Runtime Error):
n=int(input())
alist=list(map(int,input().split()))

allh=alist[0]^alist[1]
for i in range(n-1):
    allh = allh ^ alist[i+2]

outlist=[]
for a in alist:
    outlist.append(str(allh ^ a))
    outlist.append(" ")
outlist.pop()
print("".join(outlist))


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

allh=alist[0]^alist[1]
for i in range(n-2):
    allh = allh ^ alist[i+2]

outlist=[]
for a in alist:
    outlist.append(str(allh ^ a))
    outlist.append(" ")
outlist.pop()
print("".join(outlist))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
alist=list(map(int,input().split()))

xlist=[]
ylist=[]
checklist=[]

for i,a in enumerate(alist):
    xlist.append((i+1)+a)
    ylist.append((i+1)-a)
    if ((i+1)-a)>0:
        checklist.append((i+1)-a)

checklist=set(checklist)
output=0
for check in checklist:
    output+= xlist.count(check)*ylist.count(check)

print(output)


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

xdic={}
ydic={}

for i,a in enumerate(alist):
    #xlist.append((i+1)+a)
    #ylist.append((i+1)-a)
    tmpx=(i+1)+a
    tmpy=(i+1)-a
    if tmpx in xdic:
        xdic[tmpx]=xdic[tmpx]+1
    else:
        xdic[tmpx]=1
    if tmpy > 0:
        if tmpy in ydic:
            ydic[tmpy]=ydic[tmpy]+1
        else:
            ydic[tmpy]=1

output=0
for y in ydic:
    if y in xdic:
        output+= xdic[y]*ydic[y]

print(output)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
alist=list(map(int,input().split()))

xlist=[]
ylist=[]

for i,a in enumerate(alist):
    xlist.append((i+1)+a)
    ylist.append((i+1)-a)

output=0
for i in range(max(ylist)+1):
    output+= xlist.count(i)*ylist.count(i)

print(output)


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

xdic={}
ydic={}

for i,a in enumerate(alist):
    #xlist.append((i+1)+a)
    #ylist.append((i+1)-a)
    tmpx=(i+1)+a
    tmpy=(i+1)-a
    if tmpx in xdic:
        xdic[tmpx]=xdic[tmpx]+1
    else:
        xdic[tmpx]=1
    if tmpy > 0:
        if tmpy in ydic:
            ydic[tmpy]=ydic[tmpy]+1
        else:
            ydic[tmpy]=1

output=0
for y in ydic:
    if y in xdic:
        output+= xdic[y]*ydic[y]

print(output)

Buggy python submission (verdict: Time Limit Exceeded):
import copy
n=int(input())
alist=list(map(int,input().split()))
blist=copy.deepcopy(alist)

sum=0
for i,a in enumerate(alist):
    for j in range(i+a,n):
        if j-i ==a+blist[j]:
            sum+=1

print(sum)     
    


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

xdic={}
ydic={}

for i,a in enumerate(alist):
    #xlist.append((i+1)+a)
    #ylist.append((i+1)-a)
    tmpx=(i+1)+a
    tmpy=(i+1)-a
    if tmpx in xdic:
        xdic[tmpx]=xdic[tmpx]+1
    else:
        xdic[tmpx]=1
    if tmpy > 0:
        if tmpy in ydic:
            ydic[tmpy]=ydic[tmpy]+1
        else:
            ydic[tmpy]=1

output=0
for y in ydic:
    if y in xdic:
        output+= xdic[y]*ydic[y]

print(output)
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
count=0
for i in range(len(s)):
    for j in range(i+1,len(s)+1):
        if int(s[i:j])%2019 == 0:
            count+=1

print(count) 

Fixed submission:
s=input()
tmpsum=0
ruiseki=[0]
dic={}
so=2019

for i in range(1,len(s)+1):
    tmpsum+=(int(s[-i])*pow(10,i-1,so)) % so
    tmpsum%=so
    ruiseki.append(tmpsum)

for rui in ruiseki:
    if rui in dic:
        dic[rui]=dic[rui]+1
    else:
        dic[rui]=1


output=0
for val in dic.values():
    output+=val*(val-1)/2

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

if n != "7" and m != "7" and o !="7":
    print("No")
else:
    print("Yes")

Fixed submission:
t=input()
n=t[0]
m=t[1]
o=t[2]

if n != "7" and m != "7" and o !="7":
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce
import math

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

so=10**9+7

large=(pow(2,n,so)-1) % so 

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

ajogai = kumiawase(n,a) % so
bjogai = kumiawase(n,b) % so
print((large  - ajogai - bjogai + 2*so) % so)

Fixed submission:
from operator import mul
from functools import reduce
import math

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

so=10**9+7

large=(pow(2,n,so)-1)

def kumiawase(n,r):
    over=1
    for i in range(r):
        over *= n-i
        over %= so
    under = math.factorial(r)
    return over * pow(under,so-2,so)

ajogai = kumiawase(n,a) % so
bjogai = kumiawase(n,b) % so
print((large - ajogai - bjogai + 2*so) % so)

Buggy python submission (verdict: Runtime Error):
from operator import mul
from functools import reduce
import math

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

so=10**9+7

large=(pow(2,n,so))

def kumiawase(n,r):
    return math.fractorial(n) / (math.fractorial(n-r) * math.fractorial(r)

ajogai = kumiawase(n,a) % so
bjogai = kumiawase(n,b) % so
print((large - ajogai - bjogai + 2*so) % so)

Fixed submission:
from operator import mul
from functools import reduce
import math

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

so=10**9+7

large=(pow(2,n,so)-1)

def kumiawase(n,r):
    over=1
    for i in range(r):
        over *= n-i
        over %= so
    under = math.factorial(r)
    return over * pow(under,so-2,so)

ajogai = kumiawase(n,a) % so
bjogai = kumiawase(n,b) % so
print((large - ajogai - bjogai + 2*so) % so)