Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
R= inpup()
print(6.282*(int(R))**2)

Fixed submission:
R = input()
print(2*3.141*int(R))
Buggy python submission (verdict: Runtime Error):
N,K = input().split()
import math
#print(math.factorial(int(N)+1) - math.factorial(int(K)-1) -1)
print(math.factorial(int(N)+1) / math.factorial(int(K)) - math.factorial(int(K)))

Fixed submission:
N, K = map(int, input().split())

ans, saidai, saisyo = 0, 0, 0
for i in range(1, N+2):
    saisyo += i-1
    saidai += N-i+1
    if i >= K:
        ans += (saidai - saisyo + 1)
    
print(ans%(10**9+7))
Buggy python submission (verdict: Runtime Error):
 import itertools

n, k = map(int, input().split())

mod = 998244353

m_list = []

for _ in range(k):
    l, r = map(int, input().split())
    t_list = list(range(l,r+1))
    m_list.append(t_list)

m_list = list(itertools.chain.from_iterable(m_list))

dp = [0]*n
dp[0] = 1

for i in range(n):
    for j in range(len(m_list)):
        dp[i] += dp[i-m_list[j]]

print(dp[n-1] % mod)

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

mod = 998244353

m_list = []

for _ in range(k):
    m_list.append(list(map(int, input().split())))

dp = [0]*n
dp[0] = 1

dp_sum = [0]*n
dp_sum[0] = 1

for i in range(1, n):
    for j in range(k):
        l, r = m_list[j]
        il = i-l
        ir = i-r-1
        if il < 0:
            continue
        else:
            if ir < 0 :
                dp[i] += dp_sum[il]
            else:
                dp[i] += dp_sum[il] - dp_sum[ir]
            dp[i] %= mod
    dp_sum[i] = dp_sum[i-1] + dp[i]
    dp_sum[i] %= mod

print(dp[n-1] % mod)
Buggy python submission (verdict: Time Limit Exceeded):
def main():

    from builtins import input, int, map

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

    ans = 0

    for i in range(n - 1):
        for j in range(i + 1, n):
            ans += (a[i] * a[j]) % (10**9 + 7)

    print(ans % (10**9 + 7))

main()

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
mod = 10**9 + 7
ans = 0
v = sum(a)

for i in range(n - 1):
    v -= a[i]
    ans += a[i]*v

print(ans % mod)

Buggy python submission (verdict: Time Limit Exceeded):
def main():

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

    ans = 0

    for i in range(n - 1):
        for j in range(i + 1, n):
            ans += (a[i] * a[j]) % (10**9 + 7)

    print(ans % (10**9 + 7))

main()

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
mod = 10**9 + 7
ans = 0
v = sum(a)

for i in range(n - 1):
    v -= a[i]
    ans += a[i]*v

print(ans % mod)

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

ans = 0

for i in range(n - 1):
    for j in range(i + 1, n):
        ans += (a[i] * a[j]) % (10**9 + 7)

print(ans % (10**9 + 7))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
mod = 10**9 + 7
ans = 0
v = sum(a)

for i in range(n - 1):
    v -= a[i]
    ans += a[i]*v

print(ans % mod)

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

ans = 0

for i in range(n - 1):
    for j in range(i + 1, n):
        ans += a[i] * a[j]

print(ans % (10**9 + 7))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
mod = 10**9 + 7
ans = 0
v = sum(a)

for i in range(n - 1):
    v -= a[i]
    ans += a[i]*v

print(ans % mod)
Buggy python submission (verdict: Runtime Error):
l,r,d=map(int,input().split())
if l > r:
  print(0)
  break
else:
  print((r-l)//d)


Fixed submission:
l,r,d=map(int,input().split())
print(r//d-(l-1)//d)

Buggy python submission (verdict: Runtime Error):
l,r,d=map(int,input().split)
print((r-l)//d)


Fixed submission:
l,r,d=map(int,input().split())
print(r//d-(l-1)//d)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
ans = 0

for i in range(n):
  if (i+1) % 2 == 1 and a[i] % 2 == 1:
    c += 1
else:
  print(ans)


Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
c = 0
 
for i in range(N):
  if (i+1) % 2 == 1 and A[i] % 2 == 1:
    c += 1
else:
  print(c)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]
ans = 0
for i in range(n):
  if (i+1) % 2 == 1 and a[i] % 2 == 1:
    c += 1
else:
  print(ans)


Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
c = 0
 
for i in range(N):
  if (i+1) % 2 == 1 and A[i] % 2 == 1:
    c += 1
else:
  print(c)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[int(i) for i in input().split()]
ans=0
for i in range(n):
  if (i+1)%2 ==1 and a[i]%2 ==1:
    c+=1
else:
  print(ans)

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
c = 0
 
for i in range(N):
  if (i+1) % 2 == 1 and A[i] % 2 == 1:
    c += 1
else:
  print(c)
Buggy python submission (verdict: Runtime Error):
n=int(input())
x=int(input())
print(1000*x-n)


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

Buggy python submission (verdict: Runtime Error):
n=int(input())
x=[int(input()) for i in range(11)]
print(1000*x-n)

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

Buggy python submission (verdict: Runtime Error):
n=int(input())
x=int(input())
if x = 0:
    break
elif 1 <= x <= 10:
    print(1000*x-n)
elif 11 < x:
    break 


Fixed submission:
n=int(input())
a=n%1000
if a==0:
    print(0)
else:
    print(1000-a)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=list(int(input()) for i in range(n))
print('AC x',s.count('AC'))
print('WA x',s.count('WA'))
print('TLE x',s.count('TLE'))
print('RE x',s.count('RE'))


Fixed submission:
n=int(input())
s=list(input() for i in range(n))
print('AC x ',s.count('AC'))
print('WA x ',s.count('WA'))
print('TLE x ',s.count('TLE'))
print('RE x ',s.count('RE'))

Buggy python submission (verdict: Runtime Error):
n=int(input())
for i in range(n):
    if n = 'AC':
        print(n.count('AC'))
    elif n = 'WA':
        print(n.count('WA'))
    elif n = 'TLE':
        print(n.count('TLE'))
    elif n = 'RE':
        print(n.count('RE'))


Fixed submission:
n=int(input())
s=list(input() for i in range(n))
print('AC x ',s.count('AC'))
print('WA x ',s.count('WA'))
print('TLE x ',s.count('TLE'))
print('RE x ',s.count('RE'))
Buggy python submission (verdict: Runtime Error):
s=list(input())
t=list(input())
for m in range(len(m)):
    if m >= 2*10**5:
        break
    elif s != t:
        print(s[m])


Fixed submission:
s = input()
t = input()
n = len(s)
ans = 0
for i in range(n):
  if s[i] != t[i]:
    ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
a = str(input())
if a = ('A'-'Z'):
    print('A')
elif a = ('a'-'z'):
    print('a')

Fixed submission:
a=input()
if a.isupper():
    print('A')
elif a.lower():
    print('a')

Buggy python submission (verdict: Runtime Error):
a = str(input())
if a == isupper():
    print('A')
elif a == islower():
    print('a')


Fixed submission:
a=input()
if a.isupper():
    print('A')
elif a.lower():
    print('a')
Buggy python submission (verdict: Runtime Error):
a,b,c,d,e=map(int,input().split())
list=[a,b,c,d,e]
for i in list():
    if i==0:
        print(list.index(i)+1) 


Fixed submission:
a=list(map(int,input().split()))
print(a.index(0)+1)

Buggy python submission (verdict: Runtime Error):
a,b,c,d,e = int(input())
lists = ['a', 'b', 'c', 'd', 'e']
for i in range(lists(4)):
    if i == 0:
        print(i)

Fixed submission:
a=list(map(int,input().split()))
print(a.index(0)+1)

Buggy python submission (verdict: Runtime Error):
a,b,c,d,e=[int(input()) for i in range(4)]
if i == 0:
    print(range(i))


Fixed submission:
a=list(map(int,input().split()))
print(a.index(0)+1)
Buggy python submission (verdict: Runtime Error):
x,y = map(int,input().split())
a = int(input())
ans = 2*a + 4(x-a)
if ans == y:
  print('Yes')
else:
  print('No')


Fixed submission:
x,y = map(int,input().split())
#2a+4b = y
#x = a+b
#x-a = b
#2a+4(x-a) = y
#y = 4x-2a

for i in range(x+1):
  if y == 4*x - 2*i:
    print('Yes')
    break
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
x,y = map(int,input().split())
a = int(input())
ans = 2*a + 4(x-a)
if ans == y:
  print('Yes')
else:
  print('No')


Fixed submission:
x,y = map(int,input().split())
#2a+4b = y
#x = a+b
#x-a = b
#2a+4(x-a) = y
#y = 4x-2a

for i in range(x+1):
  if y == 4*x - 2*i:
    print('Yes')
    break
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

if 0 in a:
  print(0)
  break

ans = 1
for i in a:
  ans *= i
  if ans > 10**18:
    print(-1)
    break

else:
print(ans)


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

ans = 1
for i in a:
  ans *= i
  if ans > 10**18:
    print(-1)
    break

else:
    print(ans)

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

if 0 in a:
  print(0)
  break

ans = 1
for i in a:
  ans *= i
  if ans > 10**18:
    print(-1)
    break

print(ans)


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

ans = 1
for i in a:
  ans *= i
  if ans > 10**18:
    print(-1)
    break

else:
    print(ans)

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

if 0 in a:
  print(0)
  break

ans = 1
for i in a:
  ans *= a
  if ans > 10**18:
    print(-1)
    break

print(ans)


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

ans = 1
for i in a:
  ans *= i
  if ans > 10**18:
    print(-1)
    break

else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n[-1] == 3:
  print('bon')
elif n[-1] in ['0', '1', '6', '8']:
  print('pon')
else:
  print('hon')

Fixed submission:
n = input()
if n[-1] == '3':
  print('bon')
elif n[-1] in ['0', '1', '6', '8']:
  print('pon')
else:
  print('hon')

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

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

if len(s) ,= k:
  print(s)
else:
  print(s[:k] + '...')

Fixed submission:
k=int(input())
s=input()

if len(s) <= k:
  print(s)
else:
  print(s[:k] + '...')
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
for i in range(10000):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        break
else:
    print(-1)


Fixed submission:
A, B = map(int, input().split())
 
for i in range(10000):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        break
else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
for i in range(10000):
    if int(i*0.08) == A and int(i*0.1) == B:
        print(i)
        break
else:
    print(-1)


Fixed submission:
A, B = map(int, input().split())
 
for i in range(10000):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        break
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
s,t=input()
print(t+s)

Fixed submission:
s,t=input().split()
print(t+s)
Buggy python submission (verdict: Runtime Error):
S,T=input().split()
print(*[s+t for s,t in zip(S,T)],sep='')

Fixed submission:
N=input()
S,T=input().split()
print(*[s+t for s,t in zip(S,T)],sep='')
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split)
print(max(0,c-a+b))


Fixed submission:
a,b,c=map(int,input().split())
print(max(0,c-a+b))

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split)
print(c-a+b)


Fixed submission:
a,b,c=map(int,input().split())
print(max(0,c-a+b))
Buggy python submission (verdict: Runtime Error):
N=int(input())
S=input()
K=int(input())
ans=''
for i in range(N):
    if s[i]!=S[K-1]:
        ans+='*'
    else:
        ans+=S[i]
print(ans)


Fixed submission:
N=int(input())
S=input()
K=int(input())
ans=''
for i in range(N):
    if S[i] != S[K-1]:
        ans += '*'
    else:
        ans += S[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
N=int(input())
S=input()
K=int(input())
ans=''
for i in range(N):
    if s[i] != S[K-1]:
        ans += '*'
    else:
        ans += S[i]
print(ans)


Fixed submission:
N=int(input())
S=input()
K=int(input())
ans=''
for i in range(N):
    if S[i] != S[K-1]:
        ans += '*'
    else:
        ans += S[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
N=int(input())
S=input()
K=int(input())
ans=''
for i in range(N):
    if s[i] != s[K-1]:
        ans += '*'
    else:
        ans += s[i]
print(ans)


Fixed submission:
N=int(input())
S=input()
K=int(input())
ans=''
for i in range(N):
    if S[i] != S[K-1]:
        ans += '*'
    else:
        ans += S[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
p=[int(input()) for i in range(n)]
print(int(sum(p)-(max(p)/2))


Fixed submission:
n=int(input())
p=[int(input()) for i in range(n)]
print(int(sum(p)-(max(p)/2)))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split)
print(a*b-(a+b-1))


Fixed submission:
a,b=map(int,input().split())
print(a*b-(a+b-1))
Buggy python submission (verdict: Runtime Error):
s=input()
print('A'+input()[8]+'C')

Fixed submission:
print('A'+input()[8]+'C')
Buggy python submission (verdict: Runtime Error):
N= int(input())
x= 800 * N
if N < 15:
    y = 0
if 15 <= N < 30:
    y = 200
if 30 <= N < 45:
    y = 400
if 45 <= N < 60:
    y = 600
if 60 <= N < 75:
    y = 800
if 75 <= N < 100:
    y = 1000

print(x-y)

Fixed submission:
N= int(input())
x= 800 * N
if N < 15:
    y = 0
if 15 <= N < 30:
    y = 200
if 30 <= N < 45:
    y = 400
if 45 <= N < 60:
    y = 600
if 60 <= N < 75:
    y = 800
if 75 <= N <90:
    y = 1000
if 90 <= N <=100:
    y = 1200
print(x-y)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(x) for x in input().split()]

ans = 1
for aa in a:
    ans *= aa

print(ans if ans <= 10**18 else -1)

Fixed submission:
def main():
    _ = int(input())
    a = [int(x) for x in input().split()]

    if 0 in a:
        print(0)
        return

    ans = 1
    for aa in a:
        ans *= aa
        if ans > 10**18:
            print(-1)
            return

    print(ans)


main()
Buggy python submission (verdict: Runtime Error):
def main():
    h, w = map(int, input().split())

    ans = 0
    if h == 1:
        print(1)
        return 0
    if w&1:
    ans += w * (h//2)
    if h % 2 == 1:
        ans += (w+1)//2
    else:
    ans += h*(w//2)

    print(ans)

main()


Fixed submission:
def main():
    h, w = map(int, input().split())
    if h == 1 or w == 1:
        print(1)
        return 0
    ans = 0
    if w&1:
        ans += w * (h//2)
        if h % 2 == 1:
            ans += (w+1)//2
    else:
        ans += h*(w//2)

    print(ans)

main()
Buggy python submission (verdict: Runtime Error):
#include <iostream>

using namespace std;

int main() {
  int a, b; cin >> a >> b;
  for (int i = 0; i <= 10000; i++) {
    if ( i*8/100 == a && i*10/100 == b) {
      cout << i << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}

Fixed submission:
def main():
    a, b = map(int, input().split())
    for x in range(1, 100005):
        aa = x * 8 // 100
        bb = x // 10
        if aa == a and bb == b:
            print(x)
            return

    print(-1)

main()
Buggy python submission (verdict: Time Limit Exceeded):
class UnionFind:
    def __init__(self, n):
        self.parent = [ -1 for _ in range(n) ]
        self._size = n

    def unite(self, x, y):
        x, y = self.root(x), self.root(y)
        if x != y:
            if self.parent[y] < self.parent[x]:
                x, y = y, x
            self.parent[x] += self.parent[y]
            self.parent[y] = x
            self._size -= 1

    def same(self, x, y):
        return self.root(x) == self.root(y)

    def root(self, x):
        if self.parent[x] < 0:
            return x
        else:
            self.parent[x] = self.root(self.parent[x])
            return self.root(self.parent[x])

    def size(self, x):
        return -self.parent[self.root(x)]


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

uf_tree1 = UnionFind(N)
uf_tree2 = UnionFind(N)

friends = [ [] for _ in range(N) ]
blocks = [ [] for _ in range(N) ]

for _ in range(M):
    a, b = map(int, input().split())
    a -= 1; b -= 1;
    uf_tree1.unite(a, b)
    friends[a].append(b)
    friends[b].append(a)

for _ in range(K):
    c, d = map(int, input().split())
    c -= 1; d -= 1;
    uf_tree2.unite(c, d)
    blocks[c].append(d)
    blocks[d].append(c)

for i in range(N):
    ans = uf_tree1.size(i) - 1
    cand = set()
    for f in friends[i]:
        cand.add(f)
    for b in blocks[i]:
        if uf_tree1.same(i, b):
            cand.add(b)
    ans -= len(cand)
    print(ans, end = "")
    print("\n" if i == N-1 else " ", end = "")

Fixed submission:
class UnionFind:
    def __init__(self, n):
        self.parent = [ -1 for _ in range(n) ]
        self._size = n
    def unite(self, x, y):
        x, y = self.root(x), self.root(y)
        if x != y:
            if self.parent[y] < self.parent[x]:
                x, y = y, x
            self.parent[x] += self.parent[y]
            self.parent[y] = x
            self._size -= 1
    def same(self, x, y):
        return self.root(x) == self.root(y)
    def root(self, x):
        if self.parent[x] < 0:
            return x
        else:
            self.parent[x] = self.root(self.parent[x])
            return self.parent[x]
    def size(self, x):
        return -self.parent[self.root(x)]

n, m, k = map(int, input().split())
friends = [ [] for _ in range(n) ]
blocks  = [ [] for _ in range(n) ]

tree = UnionFind(n)

for _ in range(m):
    a, b = map(int, input().split())
    a -= 1; b -= 1;
    friends[a].append(b)
    friends[b].append(a)
    tree.unite(a, b)

for _ in range(k):
    a, b = map(int, input().split())
    a -= 1; b -= 1;
    blocks[a].append(b)
    blocks[b].append(a)

for i in range(n):
    ret = tree.size(i)
    s = set()
    for j in friends[i]:
        s.add(j)
    for j in blocks[i]:
        if tree.same(i, j):
            s.add(j)
    ret -= len(s)
    print(ret-1)
Buggy python submission (verdict: Time Limit Exceeded):
class BIT:
    def __init__(self, n):
        self.node = [ 0 for _ in range(n+1) ]

    def add(self, idx, w):
        i = idx
        while i < len(self.node) - 1:
            self.node[i] += w
            i |= (i + 1)

    def sum_(self, idx):
        ret, i = 0, idx-1
        while i >= 0:
            ret += self.node[i]
            i = (i & (i + 1)) - 1
        return ret

    def sum(self, l, r):
        return self.sum_(r) - self.sum_(l)


n = int(input())
s = list(input())
q = int(input())

tree = [ BIT(n) for _ in range(26) ]
for i in range(n):
    tree_id = ord(s[i]) - ord("a")
    tree[tree_id].add(i, 1)

for _ in range(q):
    query = input().split()
    com = int(query[0])
    if com == 1:
        idx, new_char = int(query[1]), query[2]
        idx -= 1
        old_char = s[idx]
        new_id = ord(new_char) - ord("a")
        old_id = ord(old_char) - ord("a")

        tree[old_id].add(idx, -1)
        tree[new_id].add(idx, 1)
        s[idx] = new_char

    if com == 2:
        l, r = int(query[1]), int(query[2])
        ret = 0
        for c in range(26):
            if tree[c].sum(l-1, r) > 0:
                ret += 1
        print(ret)

Fixed submission:
class BIT:
    def __init__(self, n):
        self.node = [ 0 for _ in range(n+1) ]

    def add(self, idx, w):
        i = idx
        while i < len(self.node) - 1:
            self.node[i] += w
            i |= (i + 1)

    def sum_(self, idx):
        ret, i = 0, idx-1
        while i >= 0:
            ret += self.node[i]
            i = (i & (i + 1)) - 1
        return ret

    def sum(self, l, r):
        return self.sum_(r) - self.sum_(l)


n = int(input())
s = list(input())
q = int(input())

tree = [ BIT(n) for _ in range(26) ]
for i in range(n):
    tree_id = ord(s[i]) - ord("a")
    tree[tree_id].add(i, 1)

for _ in range(q):
    query = input().split()
    com = int(query[0])
    if com == 1:
        idx, new_char = int(query[1]), query[2]
        idx -= 1
        old_char = s[idx]
        new_id = ord(new_char) - ord("a")
        old_id = ord(old_char) - ord("a")

        tree[old_id].add(idx, -1)
        tree[new_id].add(idx, 1)
        s[idx] = new_char

    if com == 2:
        l, r = int(query[1]), int(query[2])
        ret = 0
        for c in range(26):
            if tree[c].sum(l-1, r) > 0:
                ret += 1
        print(ret)
Buggy python submission (verdict: Runtime Error):
# return x^{-1} % mod
# it take O(log{mod})
def mod_inverse(x, mod):
    return pow(x, mod-2, mod)

# return nCk % mod
# it take O(k)
def mod_comb(n, k, mod):
    numer, denom = 1, 1
    for i in range(k):
        # numer: 分子, denom: 分母
        numer = numer * ((n-i) % mod) % mod
        denom = denom * ((i+1) % mod) % mod

    return numer * mod_inverse(denom) % mod

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


Fixed submission:
# return x^{-1} % mod
# it take O(log{mod})
def mod_inverse(x, mod):
    return pow(x, mod-2, mod)

# return nCk % mod
# it take O(k)
def mod_comb(n, k, mod):
    numer, denom = 1, 1
    for i in range(k):
        # numer: 分子, denom: 分母
        numer = numer * ((n-i) % mod) % mod
        denom = denom * ((i+1) % mod) % mod

    return numer * mod_inverse(denom, mod) % mod


n, a, b = map(int, input().split())
mod = 1000000007
ans = pow(2, n, mod) - 1
ans = (ans - mod_comb(n, a, mod)) % mod
ans = (ans - mod_comb(n, b, mod)) % mod
print( (ans + mod) % mod )
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [ input() for _ in range(n) ]

d = {}
for ss in s:
    d[ss] = d.get(ss, 0) + 1

t = set([ ss for ss in s if d[ss] == max(d.values())])
print("\n".join( sorted(list(t)) ))

Fixed submission:
n = int(input())
s = [ input() for _ in range(n) ]

d = {}
for ss in s:
    d[ss] = d.get(ss, 0) + 1

maxi = max(d.values())
t = list(set([ ss for ss in s if d[ss] == maxi]))
t.sort()
print("\n".join(t))