Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import math
import os
import sys

from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import dijkstra

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

SX, SY, TX, TY = list(map(int, sys.stdin.readline().split()))
N = int(sys.stdin.readline())
XYR = [list(map(int, sys.stdin.readline().split())) for _ in range(N)]

S = N
T = N + 1
XYR.append([SX, SY, 0])
XYR.append([TX, TY, 0])
V = []
U = []
D = []
for i, (xi, yi, ri) in enumerate(XYR):
    for j, (xj, yj, rj) in enumerate(XYR):
        if i == j:
            continue
        d = math.sqrt((xi - xj) ** 2 + (yi - yj) ** 2) - ri - rj
        V.append(i)
        U.append(j)
        D.append(max(0, d))

ret = dijkstra(csr_matrix((D, (U, V))), directed=False, indices=S)
print(ret[T])


Fixed submission:
import heapq
import math
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

SX, SY, TX, TY = list(map(int, sys.stdin.readline().split()))
N = int(sys.stdin.readline())
XYR = [list(map(int, sys.stdin.readline().split())) for _ in range(N)]

S = N
T = N + 1
XYR.append([SX, SY, 0])
XYR.append([TX, TY, 0])
graph = [[] for _ in range(N + 2)]
for i, (xi, yi, ri) in enumerate(XYR):
    for j, (xj, yj, rj) in enumerate(XYR):
        if i == j:
            continue
        d = math.sqrt((xi - xj) ** 2 + (yi - yj) ** 2) - ri - rj
        graph[i].append((max(0, d), j))

heap = [(0, S)]
heapq.heapify(heap)
dist = [IINF] * (N + 2)
while heap:
    w, v = heapq.heappop(heap)
    if w > dist[v]:
        continue
    for dw, u in graph[v]:
        if w + dw < dist[u]:
            dist[u] = w + dw
            heapq.heappush(heap, (w + dw, u))
print(dist[T])
Buggy python submission (verdict: Runtime Error):
import functools

import os
import sys

sys.setrecursionlimit(10000)
INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


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


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def inpm(line):
    return [inp() for _ in range(line)]


def inpfm(line):
    return [inpf() for _ in range(line)]


def inpsm(line):
    return [inps() for _ in range(line)]


def inlm(line):
    return [inl() for _ in range(line)]


def inlfm(line):
    return [inlf() for _ in range(line)]


def inlsm(line):
    return [inls() for _ in range(line)]


def Yesif(cond):
    print('Yes' if cond else 'No')


def YESIF(cond):
    print('YES' if cond else 'NO')


def yesif(cond):
    print('yes' if cond else 'no')

a, b, c  =inpm()

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

Fixed submission:
import functools

import os
import sys

sys.setrecursionlimit(10000)
INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


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


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def inpm(line):
    return [inp() for _ in range(line)]


def inpfm(line):
    return [inpf() for _ in range(line)]


def inpsm(line):
    return [inps() for _ in range(line)]


def inlm(line):
    return [inl() for _ in range(line)]


def inlfm(line):
    return [inlf() for _ in range(line)]


def inlsm(line):
    return [inls() for _ in range(line)]


def Yesif(cond):
    print('Yes' if cond else 'No')


def YESIF(cond):
    print('YES' if cond else 'NO')


def yesif(cond):
    print('yes' if cond else 'no')


a, b, c = inpm(3)

print(int((a + b) / 2 * c))
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18

H, W, N = list(map(int, sys.stdin.readline().split()))
AB = [list(map(int, sys.stdin.readline().split())) for _ in range(N)]

hist = set()


def count(h, w):
    ret = 0
    for dh, dw in itertools.product([-1, 0, 1], repeat=2):
        ret += (h + dh, w + dw) in hist
    return ret


def ok(a=1, b=1):
    return 1 < a < H and 1 < b < W


ans = [0] * 10
ans[0] = (H - 2) * (W - 2)
for a, b in AB:
    hist.add((a, b))
    for dh, dw in itertools.product([-1, 0, 1], repeat=2):
        if not ok(a + dh, b + dw):
            continue
        c = count(a + dh, b + dw)
        ans[c] += 1
        ans[c - 1] -= 1
print('\n'.join(map(str, ans)))


Fixed submission:
import itertools
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18

H, W, N = list(map(int, sys.stdin.readline().split()))
AB = [list(map(int, sys.stdin.readline().split())) for _ in range(N)]

hist = set()


def count(h, w):
    ret = 0
    for dh, dw in itertools.product([-1, 0, 1], repeat=2):
        ret += (h + dh, w + dw) in hist
    return ret


def ok(a=1, b=1):
    return 1 < a < H and 1 < b < W


ans = [0] * 10
ans[0] = (H - 2) * (W - 2)
for a, b in AB:
    hist.add((a, b))
    for dh, dw in itertools.product([-1, 0, 1], repeat=2):
        if not ok(a + dh, b + dw):
            continue
        c = count(a + dh, b + dw)
        ans[c] += 1
        ans[c - 1] -= 1
print('\n'.join(map(str, ans)))
Buggy python submission (verdict: Time Limit Exceeded):
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

N = int(sys.stdin.readline())
A = [int(sys.stdin.readline()) for _ in range(N)]

ans = 0
for i in range(N):
    while A[i] >= 2:
        A[i] -= 2
        ans += 1
    if i + 1 < N and A[i] >= 1 and A[i + 1] >= 1:
        A[i] -= 1
        A[i+1] -= 1
        ans += 1
print(ans)



Fixed submission:
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

N = int(sys.stdin.readline())
A = [int(sys.stdin.readline()) for _ in range(N)]

ans = 0
for i in range(N):
    while A[i] >= 2:
        ans += A[i] // 2
        A[i] %= 2
    if i + 1 < N and A[i] >= 1 and A[i + 1] >= 1:
        A[i] -= 1
        A[i+1] -= 1
        ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import os

import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

N, K = list(map(int, sys.stdin.buffer.readline().split()))
a = K
b = N - K
c = 0
d = min(a, b)
while not a == b == c:
    a, b, c = sorted([a, b, c])
    if b == c and (b - a) % d == 0:
        a = b
    elif a == b:
        a += d
    else:
        d = b - a
        a += d * 2
print(a + b + c)


Fixed submission:
import os

import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

N, K = list(map(int, sys.stdin.buffer.readline().split()))

a = K
b = N - K
c = 0
d = min(a, b)
while not a == b == c:
    a, b, c = sorted([a, b, c])
    if a != b:
        d = b - a
    cnt = (c - b) // d
    b += d * cnt
    a += d * cnt + d
print(a + b + c)

Buggy python submission (verdict: Time Limit Exceeded):
import os

import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

N, K = list(map(int, sys.stdin.buffer.readline().split()))
a = K
b = N - K
c = 0
d = min(a, b)
while not a == b == c:
    a, b, c = sorted([a, b, c])
    if a != b:
        d = b - a
    a += d
print(a + b + c)


Fixed submission:
import os

import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

N, K = list(map(int, sys.stdin.buffer.readline().split()))

a = K
b = N - K
c = 0
d = min(a, b)
while not a == b == c:
    a, b, c = sorted([a, b, c])
    if a != b:
        d = b - a
    cnt = (c - b) // d
    b += d * cnt
    a += d * cnt + d
print(a + b + c)
Buggy python submission (verdict: Runtime Error):
print(6-int(input()-int(input()))

Fixed submission:
a = int(input())
b = int(input())
l = [1, 2, 3]
l.remove(a)
l.remove(b)
print(l[0])
Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
  if a == 0:
    return b
  if b == 0:
    return a
  if a > b:
    return gcd(a%b, b)
  return gcd(a, b%a)

print(a * b // gcd(a, b))

Fixed submission:
def gcd(a, b):
  if a == 0:
    return b
  if b == 0:
    return a
  if a > b:
    return gcd(a%b, b)
  return gcd(a, b%a)

a, b = input().split()
a, b = int(a), int(b)
print(a * b // gcd(a, b))
Buggy python submission (verdict: Runtime Error):
from collections import Counter
c = True
for (k, v) in Counter(input()):
  if v != 2:
    c = False
if c:
  print("Yes")
else:
  print("No")

Fixed submission:
from collections import Counter
c = True
for (k, v) in Counter(input()).items():
  if v != 2:
    c = False
if c:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
inp = list(sorted([int(x) for x in input().split]))
print(inp[0]*inp[1]/2)

Fixed submission:
inp = list(sorted([int(x) for x in input().split()]))
print((inp[0]*inp[1])//2)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())

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

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
 
print(h * (a+b) // 2)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n,k = map(int,input().split())
    a = [int(i) for i in input().split()]
    ruiseki = [1]
    for i in range(n):
        ruiseki.append(ruiseki[-1]*a[i])
    #ruiseki.pop(0)
    
    ans = [ruiseki[k]/ruiseki[0]]
    for i in range(k+1,n+1):
        tmp = ruiseki[i]/ruiseki[i-k]
        if ans[-1] >= tmp:
            print('No')
        else:
            print('Yes')
        ans.append(tmp)
    
main()

Fixed submission:
def main():
    n,k = map(int,input().split())
    a = [int(i) for i in input().split()]
    """
    ruiseki = [1]
    for i in range(n):
        ruiseki.append(ruiseki[-1]*a[i])
    #ruiseki.pop(0)
    
    ans = [ruiseki[k]/ruiseki[0]]
    for i in range(k+1,n+1):
        tmp = ruiseki[i]/ruiseki[i-k]
        if ans[-1] >= tmp:
            print('No')
        else:
            print('Yes')
        ans.append(tmp)
    """
    for i in range(k,n):
        if a[i]>a[i-k]:
            print('Yes')
        else:
            print('No')
main()
Buggy python submission (verdict: Runtime Error):
n = int(input())
A = [int(i) for i in input().split()]
Max = max(A)
cnt_dict = collections.Counter(A)
#Dict[i]はi未満の約数がAに存在しなければTrue
Dict = {a:True for a in A}
for a in A:
    times = 2
    while a*times<=Max:
        Dict[a*times]=False
        times +=1
ans = 0
for a in A:
    if cnt_dict[a]==1 and Dict[a]:
        ans +=1
print(ans)


Fixed submission:
from collections import deque
import collections
import math
"""
#n = int(input())
#A = [int(i) for i in input().split()]
n = 10**5
A = [int(i)+1 for i in range(10**5,0,-1)]
A.sort()
ans = 0
ans_list = []
kaburi = {}
for i in A:
    Flag = True
    for j in ans_list:
        if i==j:
            kaburi[i]=True
            Flag = False
            break
        if i%j==0:
            Flag = False
            break
    if Flag:
        ans_list.append(i)
        ans += 1
print(ans-len(kaburi))
"""


n = int(input())
A = [int(i) for i in input().split()]
Max = max(A)
cnt_dict = collections.Counter(A)
#Dict[i]はi未満の約数がAに存在しなければTrue
Dict = {a:True for a in A}
for a in A:
    times = 2
    while a*times<=Max:
        Dict[a*times]=False
        times +=1
ans = 0
for a in A:
    if cnt_dict[a]==1 and Dict[a]:
        ans +=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = [int(i) for i in input().split()]
A.sort()
ans = 0
ans_list = []
kaburi = {}
for i in A:
    Flag = True
    for j in ans_list:
        if i==j:
            kaburi[i]=True
            Flag = False
            break
        if i%j==0:
            Flag = False
            break
    if Flag:
        ans_list.append(i)
        ans += 1
print(ans-len(kaburi))

Fixed submission:
from collections import deque
import collections
import math
"""
#n = int(input())
#A = [int(i) for i in input().split()]
n = 10**5
A = [int(i)+1 for i in range(10**5,0,-1)]
A.sort()
ans = 0
ans_list = []
kaburi = {}
for i in A:
    Flag = True
    for j in ans_list:
        if i==j:
            kaburi[i]=True
            Flag = False
            break
        if i%j==0:
            Flag = False
            break
    if Flag:
        ans_list.append(i)
        ans += 1
print(ans-len(kaburi))
"""


n = int(input())
A = [int(i) for i in input().split()]
Max = max(A)
cnt_dict = collections.Counter(A)
#Dict[i]はi未満の約数がAに存在しなければTrue
Dict = {a:True for a in A}
for a in A:
    times = 2
    while a*times<=Max:
        Dict[a*times]=False
        times +=1
ans = 0
for a in A:
    if cnt_dict[a]==1 and Dict[a]:
        ans +=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
ans = 1
n = int(input())
A = [int(i) for i in input().split()]
A.sort()
for i in A:
    if i==0:
        print('0')
        exit()
    ans *= i
if ans>10**18:
        print('-1')
        exit()
print(ans)

Fixed submission:
ans = 1
n = int(input())
A = [int(i) for i in input().split()]
A.sort()
for i in A:
    if i==0:
        print('0')
        exit()
    ans *= i
    if ans>10**18:
        print('-1')
        exit()
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

ans = 1
n = int(input())
A = [int(i) for i in input().split()]
A = np.array(A,dtype='object')
ans = np.prod(A)
if ans ==0:
    print(0)
    exit()

if ans > 10**18:
    print('-1')
    exit()
print(int(ans))

Fixed submission:
ans = 1
n = int(input())
A = [int(i) for i in input().split()]
A.sort()
for i in A:
    if i==0:
        print('0')
        exit()
    ans *= i
    if ans>10**18:
        print('-1')
        exit()
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
ans = 1
n = int(input())
A = [int(i) for i in input().split()]

for i in A:
    ans *= i
if ans>10**18:
    print('-1')
    exit()
print(ans)

Fixed submission:
ans = 1
n = int(input())
A = [int(i) for i in input().split()]
A.sort()
for i in A:
    if i==0:
        print('0')
        exit()
    ans *= i
    if ans>10**18:
        print('-1')
        exit()
print(ans)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
A = [int(i) for i in input().split()]

Visit = [False for i in range(n+1)]

loop_st,loop_end,loop_len = 0,0,0
st = 1
releki = []
for i in range(10000000000000):
    
    if Visit[st] == True:
        loop_key = st
        loop_st = releki.index(loop_key)
        loop_end = len(releki)-loop_st
        loop_len = len(releki)-loop_st-1
        break
    releki.append(st)
    Visit[st] = True
    st = A[st-1]
k-= loop_st
print(releki[loop_len%k])

Fixed submission:
n,k = map(int,input().split())
A = [int(i) for i in input().split()]

Visit = [False for i in range(n+1)]

loop_st,loop_end,loop_len = 0,0,0
st = 1
releki = []
loop_list = []
for i in range(10000000000000):
    if Visit[st] == True:
        loop_key = st
        loop_st = releki.index(loop_key)
        loop_end = len(releki)-loop_st
        loop_list = releki[loop_st:]
        loop_len = len(loop_list)
        break
    releki.append(st)
    Visit[st] = True
    st = A[st-1]
if k <loop_st:
    print(releki[k])
    exit()
k -= loop_st

print(loop_list[k%loop_len])

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
A = [int(i) for i in input().split()]

Visit = [False for i in range(n+1)]

loop_st,loop_end,loop_len = 0,0,0
st = 1
releki = []
for i in range(1000000):
    
    if Visit[st] == True:
        loop_key = st
        loop_st = releki.index(loop_key)
        loop_end = len(releki)-loop_st
        loop_len = len(releki)-loop_st-1
        break
    releki.append(st)
    Visit[st] = True
    st = A[st-1]
k-= loop_st
print(releki[loop_len%k])

Fixed submission:
n,k = map(int,input().split())
A = [int(i) for i in input().split()]

Visit = [False for i in range(n+1)]

loop_st,loop_end,loop_len = 0,0,0
st = 1
releki = []
loop_list = []
for i in range(10000000000000):
    if Visit[st] == True:
        loop_key = st
        loop_st = releki.index(loop_key)
        loop_end = len(releki)-loop_st
        loop_list = releki[loop_st:]
        loop_len = len(loop_list)
        break
    releki.append(st)
    Visit[st] = True
    st = A[st-1]
if k <loop_st:
    print(releki[k])
    exit()
k -= loop_st

print(loop_list[k%loop_len])
Buggy python submission (verdict: Time Limit Exceeded):
from decimal import Decimal
import math
a,b,n = map(str,input().split())

a = Decimal(a)
b = Decimal(b)
n = int(n)
ans = 0
for x in range(1,n+1):
    tmp = math.floor((a*x)/b) - a*math.floor(x/b)
    ans = max(ans,tmp)

print(ans)

Fixed submission:
from decimal import Decimal
import math
a,b,n = map(str,input().split())

a = Decimal(a)
b = Decimal(b)
n = int(n)
ans = 0
kouho = [min(b-1,n)]
for x in kouho:
    tmp = math.floor((a*x)/b) - a*math.floor(x/b)
    ans = max(ans,tmp)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math


k = int(input())
ans = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for x in range(1,k+1):
            ans +=math.gcd(i,math.gcd(j,x)) 

            
print(ans)


Fixed submission:
import math


k = int(input())
ans = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        tmp = math.gcd(i,j)
        for x in range(1,k+1):
            ans +=math.gcd(tmp,x) 

            
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
import numpy as np
k = int(input())

Map = [[0 for j in range(k)] for i in range(k)]
for i  in range(1,k+1):
    for j in range(1,k+1):
        tmp = math.gcd(i,j)
        Map[i-1][j-1] = tmp
        Map[j-1][i-1] = tmp

ans = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for x in range(1,k+1):
            tmp = [i,j,x]
            tmp_ans = Map[tmp[0]-1][tmp[2]-1]
            ans += Map[tmp_ans-1][tmp[1]-1]
            
            
print(ans)


Fixed submission:
import math


k = int(input())
ans = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        tmp = math.gcd(i,j)
        for x in range(1,k+1):
            ans +=math.gcd(tmp,x) 

            
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
S = input()
ans = 0
for i in range(1,len(S)+1):
    for j in range(i+1,len(S)+1):
        for k in range(j+1,len(S)+1):
            if j-i==k-j:
                continue
            if S[i-1]!=S[j-1] and S[i-1]!=S[k-1] and S[j-1]!=S[k-1]:
                ans +=1
print(ans)

Fixed submission:
n = int(input())
S = input()
ans = S.count('R') * S.count('G') * S.count('B')
for i in range(n):
    for j in range(i+1,n):
        k = 2*j-i
        if k>=n:
            continue
        if S[i]==S[j] or S[j]==S[k] or S[i]==S[k]:
            continue
        else:
            ans -=1
print(ans)
Buggy python submission (verdict: Runtime Error):
import copy
def main():
    n,m = map(int,input().split())
    ans = [0 for i in range(n)]
    for i in range(m):
        s,c = map(int,input().split())
        if ans[s-1] !=0:
            ans[s-1] = min(ans[s-1],c)
        else:
            ans[s-1] = c
    ans = ans[0]*100 + ans[1]*10 + ans[2]
    cnt = 1
    copy_ans = copy.deepcopy(ans)
    while copy_ans > 10:
        copy_ans /= 10
        cnt += 1
    if cnt==n:
        print(ans)
    else:
        print('-1')

main()

Fixed submission:
import copy
def main():
    n,m = map(int,input().split())
    sc = []
    for i in range(m):
        s,c = map(int,input().split())
        sc.append([s,str(c)])
    if n==1:
        for i in range(10):
            flag = True
            tmp = str(i)
            tmp = list(tmp)
            tmp = ['0' for j in range(n-len(tmp))] + tmp
            for j in range(m):
                if tmp[sc[j][0]-1] !=sc[j][1]:
                    flag = False
            if flag:
                print(i)
                exit()
            
    else:        
        for i in range(10**(n-1),10**n):
            flag = True
            tmp = str(i)
            tmp = list(tmp)
            tmp = ['0' for j in range(n-len(tmp))] + tmp
            
            for j in range(m):
                if tmp[sc[j][0]-1] !=sc[j][1]:
                    flag = False
            if flag:
                print(i)
                exit()
    print('-1')
main()
Buggy python submission (verdict: Runtime Error):
from scipy.special import comb
import math
n,a,b = map(int,input().split())
Mod = 10**9+7



def Mod_pow(x, n):
    x = x%Mod
    if n==0:
        return 1
    elif n%2==1:
        return (x*Mod_pow(x,n-1)%Mod)
    else:
        return (Mod_pow(x*x,n/2)%Mod)


def comb(n,r):
    x,y = 1,1
    for i in range(n-r+1,n+1):
        x = x*i%Mod

    for i in range(1,r+1):
        y = y*i%Mod

    #この問題の特徴，フェルマーの小定理よりyで除算することはy^(Mod-2)をかけることと同値
    y = Mod_pow(y,Mod-2)
    return x*y%Mod

ans = (Mod_pow(2,n)-1-comb(n,a)-comb(n,b))
while ans<0:
    ans += Mod

print(ans)

Fixed submission:
n,a,b = map(int,input().split())
Mod = 10**9+7



def Mod_pow(x, n):
    x = x%Mod
    if n==0:
        return 1
    elif n%2==1:
        return (x*Mod_pow(x,n-1)%Mod)
    else:
        return (Mod_pow(x*x,n/2)%Mod)


def comb(n,r):
    x,y = 1,1
    for i in range(n-r+1,n+1):
        x = x*i%Mod

    for i in range(1,r+1):
        y = y*i%Mod

    #この問題の特徴，フェルマーの小定理よりyで除算することはy^(Mod-2)をかけることと同値
    y = Mod_pow(y,Mod-2)
    return x*y%Mod

ans = (Mod_pow(2,n)-1-comb(n,a)-comb(n,b))
while ans<0:
    ans += Mod

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,k = map(int,input().split())

for i in range(k):
  if a>=1:
    a-=1
  elif b>=1:
    b-=1
  else:
    continue

print(a,b)

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

if a-k>0:
  a -= k
  print(a,b)
  exit()
else:
  k -= a
  a = 0
if b-k>0:
  b -=k
  print(a,b)
  exit()
else:
  print(a,0)
Buggy python submission (verdict: Runtime Error):
,k = map(int,input().split())
R,S,P =map(int,input().split())
T = list(input())
value= {'r':P,'s':R,'p':S}
ans = 0
pre = ''
#k個ごとのグループで考える
for i in range(k):
    num = i
    while num<n:
        if pre == T[num]:#同じ手だったら負けかあいこ．つまり0点カウント
            pre = ''
        else:
            pre = T[num]
            ans += value[pre]
        num += k
print(ans)


Fixed submission:
n,k = map(int,input().split())
R,S,P =map(int,input().split())
T = list(input())
value= {'r':P,'s':R,'p':S}
ans = 0
#k個ごとのグループで考える
for i in range(k):
    num = i
    pre = ''
    while num<n:
        if pre == T[num]:#同じ手だったら負けかあいこ．つまり0点カウント
            pre = ''
        else:
            pre = T[num]
            ans += value[pre]
        num += k
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a,b = map(int,input().split())
i  = max(a,b)
while i%a+i%b>0:
  i+=1
print(i)

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