Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
import copy
sys.setrecursionlimit(10**6)

# lis_of_lis = [[] for _ in range(N)]


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()[:-1]


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


MOD = pow(10, 9)+7

N = z()
A = zz()
ans = 0
for i in range(N):
    for j in range(i + 1, N):
        ans += A[i]*A[j]
        ans %= MOD
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
import copy
sys.setrecursionlimit(10**6)

# lis_of_lis = [[] for _ in range(N)]


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()[:-1]


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


MOD = pow(10, 9)+7

N = z()
A = zz()
ans = 0
part_sum = [0]*N
part_sum[0] = A[0]
sum_a = sum(A) % MOD
for i in range(1, N):
    part_sum[i] = (part_sum[i-1] + A[i]) % MOD

for i in range(N - 1):
    tmp = A[i]*(sum_a - part_sum[i])
    ans = (ans+tmp) % MOD
    ans = ans % MOD
print(ans)

# for i in range(N):
#     for j in range(i + 1, N):
#         ans += A[i]*A[j]
#         ans %= MOD
# print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
import copy
import math
sys.setrecursionlimit(10**6)

# lis_of_lis = [[] for _ in range(N)]


def zz(): return list(map(int, sys.stdin.readline().split()))


def z(): return int(sys.stdin.readline())


def S(): return sys.stdin.readline()[:-1]


def C(line): return [sys.stdin.readline() for _ in range(line)]

# a,bの最大公約数


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

# a,bの最小公倍数


def lcm(a, b):
    return a * b // gcd(a, b)


def get_sieve_of_eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]


max_a = pow(10, 6)+5
N = z()
A = zz()
pari_flg = True

set_flg = True
count = [0]*max_a
for i in range(N):
    count[A[i]] = 1
for i in range(2, max_a):
    c = 0
    for j in range(i, max_a, i):
        c += count[j]
        if (c > 1):
            pari_flg = False
res = A[0]
for i in range(1, N):
    res = gcd(res, A[i])
if (res != 1):
    set_flg = False

if (pari_flg):
    print('pairwise coprime')
elif (set_flg):
    print('setwise coprime')
else:
    print('not coprime')


Fixed submission:
# -*- coding: utf-8 -*-
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
import copy
import math
sys.setrecursionlimit(10**6)

# lis_of_lis = [[] for _ in range(N)]


def zz(): return list(map(int, sys.stdin.readline().split()))


def z(): return int(sys.stdin.readline())


def S(): return sys.stdin.readline()[:-1]


def C(line): return [sys.stdin.readline() for _ in range(line)]

# a,bの最大公約数


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

# a,bの最小公倍数


def lcm(a, b):
    return a * b // gcd(a, b)


def get_sieve_of_eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]


max_a = pow(10, 6)+5
N = z()
A = zz()
pari_flg = True

set_flg = True
count = [0]*max_a
for i in range(N):
    count[A[i]] += 1
for i in range(2, max_a):
    c = 0
    for j in range(i, max_a, i):
        c += count[j]
        if (c > 1):
            pari_flg = False
res = A[0]
for a in A:
    res = math.gcd(res, a)
if (res != 1):
    set_flg = False

if (pari_flg):
    print('pairwise coprime')
elif (set_flg):
    print('setwise coprime')
else:
    print('not coprime')
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from scipy.special import comb
import copy
sys.setrecursionlimit(10**6)


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()[:-1]


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


N, K = zz()
A = zz()
hyouka = [1] * (N)
mul_A = [1]*(N+1)
mul_A[0] = 1
# mul_A[1] = A[0]
for i in range(N):
    mul_A[i] *= mul_A[i-1]*A[i]

for i in range(K - 1, N):
    # print(mul_A[i], mul_A[i-K])
    hyouka[i] = mul_A[i]//mul_A[i-K]


# print(hyouka[K-1:])
prev = hyouka[K-1]
for now in hyouka[K:]:
    if (prev < now):
        print('Yes')
    else:
        print('No')
    prev = now


Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from scipy.special import comb
import copy
sys.setrecursionlimit(10**6)


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()[:-1]


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


N, K = zz()
A = zz()

for i in range(K, N):
    # print(i, i-K)
    if (A[i] > A[i - K]):
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from scipy.special import comb
import copy
sys.setrecursionlimit(10**6)


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()[:-1]


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


N, K = zz()
A = zz()
hyouka = [1] * (N)

for i in range(K - 1, N):
    for j in range(K):
        # print(j)
        hyouka[i] *= A[i-j]
# print(hyouka)
prev = hyouka[K-1]
for now in hyouka[K:]:
    if (prev < now):
        print('Yes')
    else:
        print('No')
    prev = now


Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from scipy.special import comb
import copy
sys.setrecursionlimit(10**6)


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()[:-1]


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


N, K = zz()
A = zz()

for i in range(K, N):
    # print(i, i-K)
    if (A[i] > A[i - K]):
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from itertools import accumulate
import copy


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()


def C(line):
    return [sys.stdin.readline()[:-1] for _ in range(line)]


N = z()
for n in range(1, N + 1):
    ans = 0
    for x in range(1, 45):
        for y in range(x, 45):
            for z in range(y, 45):
                if(x**2+y**2+z**2+x*y+y*z+x*z == n):
                    if(x == y == z):
                        ans += 1
                    elif ((x == y) or (x == z) or (y == z)):
                        ans += 3
                    else:
                        ans += 6
    print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from itertools import accumulate
import copy


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()


def C(line):
    return [sys.stdin.readline()[:-1] for _ in range(line)]


N = z()
ans = [0]*N
for x in range(1, 105):
    for y in range(1, 105):
        for z in range(1, 105):
            if(x**2+y**2+z**2+x*y+y*z+x*z <= N):
                ans[x**2+y**2+z**2+x*y+y*z+x*z - 1] += 1
for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


N = z()
for n in range(1, N + 1):
    ans = 0
    for x in range(1, 51):
        for y in range(1, 51):
            for z in range(1, 51):
                if(x**2+y**2+z**2+x*y+y*z+x*z == n):
                    ans += 1
    print(ans)

# for x,y,z in itertools.product()


Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from itertools import accumulate
import copy


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()


def C(line):
    return [sys.stdin.readline()[:-1] for _ in range(line)]


N = z()
ans = [0]*N
for x in range(1, 105):
    for y in range(1, 105):
        for z in range(1, 105):
            if(x**2+y**2+z**2+x*y+y*z+x*z <= N):
                ans[x**2+y**2+z**2+x*y+y*z+x*z - 1] += 1
for i in ans:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
import math


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]


N = z()
ans = 0
for i in range(1, N+1):
    for j in range(1, N+1):
        if (i % j == 0):
            ans += i
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
# import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
import math


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]


N = z()
yakusu_nums = [0]*(N+1)
for i in range(1, N+1):
    for j in range(i, N+1, i):
        yakusu_nums[j] += 1
ans = 0
for i, yakusu_num in enumerate(yakusu_nums):
    # print(i, yakusu_num)
    ans += i*yakusu_num
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect


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


def z():
    return int(input())


def S():
    return input()


def C(line):
    return [input() for _ in range(line)]


N = z()
a = zz()
ans = []
for i in range(N):
    tmp_ans = 0
    lis = a[:i] + a[i+1:]
    for ai in lis:
        tmp_ans ^= ai
    ans.append(tmp_ans)

print(*ans)
# i番目以外のxorの合計がai


Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect


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


def z():
    return int(input())


def S():
    return input()


def C(line):
    return [input() for _ in range(line)]


N = z()
a = zz()
ans = []
all_xor = 0
for _a in a:
    all_xor ^= _a

for i in range(N):
    tmp = -(all_xor ^ (~a[i])) - 1
    ans.append(tmp)
print(*ans)
# i番目以外のxorの合計がai
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np
from collections import deque
import collections
import heapq
N = int(input())
a = list(map(int, input().split()))
ans = 1
max_ = pow(10, 18)
for tmp in a:
    ans *= tmp
if (ans > max_):
    print(-1)
else:
    print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
from collections import deque
import collections
import heapq
N = int(input())
a = list(map(int, input().split()))
ans = 1
max_ = pow(10, 18)
if 0 in a:
    print(0)
    exit()
for tmp in a:
    ans *= tmp
    if (ans > max_):
        print(-1)
        exit()
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np
n = int(input())
A = list(map(int, input().split()))
A_p = np.array([a + (i+1) for i, a in enumerate(A)])
A_m = np.array([a - (i+1) for i, a in enumerate(A)])
# print(A_p)
# print(A_m)
count = 0
for i in range(1, n+1):
    tmp = A_p[:i] + A_m[n-i:n]
    # print(tmp)
    # print(np.count_nonzero(tmp))
    tmp2 = A_p[n-i:n] + A_m[:i]
    count += len(tmp) - np.count_nonzero(tmp)
    count += len(tmp2) - np.count_nonzero(tmp2)

print(count)


Fixed submission:
from collections import defaultdict

n = int(input())
a = list(map(int, input().split()))
ap = defaultdict(int)
for i in range(n):
    ap[i - a[i]] += 1

ans = 0
for i in range(n):
    ans += ap[a[i] + i]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
n = int(input())
A = list(map(int, input().split()))
count = 0
for i in range(n-1):
    for j in range(i+1, n):
        if A[i] + A[j] == j-i:
            count += 1
print(count)


Fixed submission:
from collections import defaultdict

n = int(input())
a = list(map(int, input().split()))
ap = defaultdict(int)
for i in range(n):
    ap[i - a[i]] += 1

ans = 0
for i in range(n):
    ans += ap[a[i] + i]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np
from collections import deque
n, m, q = list(map(int, input().split()))
a, b, c, d = [0] * q, [0] * q, [0] * q, [0] * q

for i in range(q):
    a[i], b[i], c[i], d[i] = list(map(int, input().split()))
# Aは単調増加数列でNこの要素を持って最大でもMまで
ans = 0
locked_index = []
# dp = [0]*q
# dp[0] = d[0]
# for i in range(1, q):
#     # 普通に追加できるとき
#     if(a[i] in locked_index and b[i] in locked_index):

#     dp[i] = dp[i-1] + d[i]
#     locked_index.append(a[i])
#     locked_index.append(b[i])

max_point = 0

for i in range(2 ** q):
    ok_flg = True
    point = 0
    A = [1]*(n+1)
    locked_index = []
    saiyou = []
    for j in range(q):
        if ((i >> j) & 1):
            point += d[j]
            saiyou.append(j)
            A[b[j]] = A[a[j]] + c[j]
            if ((A[b[j]] > m)):
                ok_flg = False
                break
    # if(point == 357500):

    # ここで最終チェック
    for j in saiyou:
        if (A[b[j]] != A[a[j]] + c[j]):
            ok_flg = False

    # print(A, '\n', point)
    # print(saiyou)
    # print('==============')
    if max_point < point and ok_flg:
        max_point = point
print(max_point)
# A[b[i]] - A[a[i]] == c[i]


Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
from collections import deque
import itertools

n, m, q = list(map(int, input().split()))
a, b, c, d = [0] * q, [0] * q, [0] * q, [0] * q

for i in range(q):
    a[i], b[i], c[i], d[i] = list(map(int, input().split()))
    a[i] -= 1
    b[i] -= 1
# Aは単調増加数列でNこの要素を持って最大でもMまで
ans = 0
for seq in itertools.combinations_with_replacement(range(m), n):
    tmp = 0
    for i in range(q):
        if seq[b[i]]-seq[a[i]] == c[i]:
            tmp += d[i]
    ans = max(ans, tmp)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
s = input()
mods = [0]*2019
mods[0] += 1
for i in range(len(s)):
    value = int(s[i:])
    mods[value % 2019] += 1
print(sum([mod*(mod-1)//2 for mod in mods]))


Fixed submission:
# -*- coding: utf-8 -*-
s = input()
mods = [0]*2019
mods[0] += 1
# for i in range(len(s)):
#     value = int(s[i:])
#     mods[value % 2019] += 1
base = 1
value = 0
for c in map(int, reversed(s)):
    value += (c*base) % 2019
    base = (base * 10) % 2019
    # value = int(s[i:])
    mods[value % 2019] += 1
print(sum([mod*(mod-1)//2 for mod in mods]))

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
s = input()
mods = [0]*2019
mods[0] += 1
for i in range(len(s)):
    value = int(s[i:])
    # print(value)
    # print(value % 2019)
    # print('==========-')
    mods[value % 2019] += 1
ans = 0
for mod in mods:
    ans += (mod)*(mod-1)//2

print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
s = input()
mods = [0]*2019
mods[0] += 1
# for i in range(len(s)):
#     value = int(s[i:])
#     mods[value % 2019] += 1
base = 1
value = 0
for c in map(int, reversed(s)):
    value += (c*base) % 2019
    base = (base * 10) % 2019
    # value = int(s[i:])
    mods[value % 2019] += 1
print(sum([mod*(mod-1)//2 for mod in mods]))

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
s = input()
count = 0
for i in range(len(s)):
    for j in range(i+5, len(s)+1):
        if (int(s[i:j]) % 2019 == 0):
            count += 1
print(count)


Fixed submission:
# -*- coding: utf-8 -*-
s = input()
mods = [0]*2019
mods[0] += 1
# for i in range(len(s)):
#     value = int(s[i:])
#     mods[value % 2019] += 1
base = 1
value = 0
for c in map(int, reversed(s)):
    value += (c*base) % 2019
    base = (base * 10) % 2019
    # value = int(s[i:])
    mods[value % 2019] += 1
print(sum([mod*(mod-1)//2 for mod in mods]))

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
s = input()
count = 0
for i in range(len(s)):
    for j in range(i+4, len(s)+1):
        # print(s[i:j])
        if (int(s[i:j]) % 2019 == 0):
            count += 1
print(count)


Fixed submission:
# -*- coding: utf-8 -*-
s = input()
mods = [0]*2019
mods[0] += 1
# for i in range(len(s)):
#     value = int(s[i:])
#     mods[value % 2019] += 1
base = 1
value = 0
for c in map(int, reversed(s)):
    value += (c*base) % 2019
    base = (base * 10) % 2019
    # value = int(s[i:])
    mods[value % 2019] += 1
print(sum([mod*(mod-1)//2 for mod in mods]))
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np
N, X, Y = list(map(int, input().split()))

distance_lis = [0]*(N-1)
for i in range(1, N + 1):
    for j in range(i+1, N + 1):
        # XYを使わない場合
        a = j - i
        b = np.abs(X - i) + np.abs(Y - j) + 1
        distance = min(a, b)
        distance_lis[distance-1] += 1
for dis in distance_lis:
    print(dis)


Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
N, X, Y = list(map(int, input().split()))

distance_lis = [0]*(N-1)
for i in range(1, N + 1):
    for j in range(i+1, N + 1):
        # XYを使わない場合
        a = j - i
        b = abs(X - i) + abs(Y - j) + 1
        distance = min(a, b)
        distance_lis[distance-1] += 1
for dis in distance_lis:
    print(dis)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np
N, X, Y = list(map(int, input().split()))

distance_lis = np.zeros(N-1, dtype=np.int32)
for i in range(1, N + 1):
    for j in range(i+1, N + 1):
        # XYを使わない場合
        a = j - i
        b = np.abs(X - i) + np.abs(Y - j) + 1
        distance = min(a, b)
        distance_lis[distance-1] += 1
for dis in distance_lis:
    print(dis)


Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
N, X, Y = list(map(int, input().split()))

distance_lis = [0]*(N-1)
for i in range(1, N + 1):
    for j in range(i+1, N + 1):
        # XYを使わない場合
        a = j - i
        b = abs(X - i) + abs(Y - j) + 1
        distance = min(a, b)
        distance_lis[distance-1] += 1
for dis in distance_lis:
    print(dis)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
S = (input())
# 出力
# 奇数を取得
if(S[0] == s[1] == s[2]):
    print('No')
else:
    print('Yes')


Fixed submission:
# -*- coding: utf-8 -*-
S = (input())
# 出力
# 奇数を取得
if(S[0] == S[1] == S[2]):
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
mod = 10**9 + 7
n, a, b = map(int, input().split())
ans = pow(2, n, mod)-1

# a
x = 1
for i in range(n - a + 1, n + 1):
    x *= i
y = 1
for i in range(1, a + 1):
    y *= i

a_ans = x*pow(y, mod-2, mod)

x = 1
for i in range(n - b + 1, n + 1):
    x *= i
y = 1
for i in range(1, b + 1):
    y *= i
b_ans = x*pow(y, mod-2, mod)
print((ans - a_ans - b_ans) % mod)


Fixed submission:
mod = 10**9 + 7
n, a, b = map(int, input().split())
ans = pow(2, n, mod)-1


def nck(n, k, mod):
    bunbo = bunshi = 1
    for i in range(k):
        bunshi = (bunshi * (n-i)) % mod
        bunbo = (bunbo * (i+1)) % mod
    return (bunshi * pow(bunbo, mod-2, mod)) % mod


print((ans - nck(n, a, mod) - nck(n, b, mod)) % mod)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np
from collections import deque
n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
max_value = 0
ans_p = 0
for i in range(n):
    sum_ = sum(p[i:i+k])
    if (sum_ > max_value):
        max_value = sum_
        ans_p = p[i:i+k]
print((max_value+k)/2)


Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
from collections import deque
n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
max_value = 0
ans_p = 0

s = [0]*(n+1)
for i, _p in enumerate(p):
    s[i+1] = s[i] + _p

for i in range(n-k+1):
    sum_ = s[i+k] - s[i]
    if (max_value < sum_):
        max_value = sum_

print((max_value+k)/2)