Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
N = int(input())
s = [0] * N
answer = 0
for i in range(N):
    s[i] = int(input())
for i in range(1, N+1):  # 何問正解するか、0からN問まで
    for v in itertools.combinations(s, i):
        if sum(v) % 10 != 0 and answer <= sum(v):
            answer = sum(v)
        # print(v, sum(v))

print(answer)
        

Fixed submission:
import itertools
N = int(input())
s = [0] * N
not10 = []
answer = 0
for i in range(N):
    s[i] = int(input())

SUM = sum(s)
if SUM % 10 != 0:
    print(SUM)
    exit()
else:
    for i in range(N):
        if s[i] % 10 != 0:
            not10.append(s[i])
    not10.sort()
    if len(not10) == 0:
        print(0)
    else:
        print(SUM - not10[0])
    exit()
            
# print(not10)

# for i in range(1, N+1):  # 何問正解するか、0からN問まで
#     for v in itertools.combinations(s, i):
#         if sum(v) % 10 != 0 and answer <= sum(v):
#             answer = sum(v)
#         print(v, sum(v))

# print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
N = int(input())
s = [0] * N
answer = 0
for i in range(N):
    s[i] = int(input())
for i in range(1, N+1):  # 何問正解するか、0からN問まで
    for v in itertools.combinations(s, i):
        if sum(v) % 10 != 0:
            if answer <= sum(v):
                answer = sum(v)
        # print(v)

print(answer)
        

Fixed submission:
import itertools
N = int(input())
s = [0] * N
not10 = []
answer = 0
for i in range(N):
    s[i] = int(input())

SUM = sum(s)
if SUM % 10 != 0:
    print(SUM)
    exit()
else:
    for i in range(N):
        if s[i] % 10 != 0:
            not10.append(s[i])
    not10.sort()
    if len(not10) == 0:
        print(0)
    else:
        print(SUM - not10[0])
    exit()
            
# print(not10)

# for i in range(1, N+1):  # 何問正解するか、0からN問まで
#     for v in itertools.combinations(s, i):
#         if sum(v) % 10 != 0 and answer <= sum(v):
#             answer = sum(v)
#         print(v, sum(v))

# print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
H, W = map(int, input().split())
if H % 3 == 0 or W % 3 == 0:    # 3の倍数だったら最小値は0
    print(0)
    exit()
answer = float('inf')
h = 1
for _ in range(((H-1)//2)+1):
    a = h * W
    w = 1
    for _ in range(((W-1)//2)+1):
        b = (H-h) * w
        c = H * W - a - b
        MAX = max([a, b, c])
        MIN = min([a, b, c])
        if MAX - MIN <= answer:
            answer = MAX - MIN
        w += 1
    h += 1

w = 1
for _ in range(((W-1)//2)+1):
    a = w * H
    h = 1
    for _ in range(((H-1)//2)+1):
        b = (W-w) * h
        c = H * W - a - b
        MAX = max([a, b, c])
        MIN = min([a, b, c])
        if MAX - MIN <= answer:
            answer = MAX - MIN
        h += 1
    w += 1

print(answer)

Fixed submission:
H, W = map(int, input().split())
if H % 3 == 0 or W % 3 == 0:    # 3の倍数だったら最小値は0
    print(0)
    exit()

answer = float('inf')

h = 1
for _ in range(H):
    a = h * W
    b = (H-h) * (W // 2)
    c = H * W - a - b
    MAX = max([a, b, c])
    MIN = min([a, b, c])
    if MAX - MIN <= answer:
        answer = MAX - MIN
    h += 1

w = 1
for _ in range(W):
    a = w * H
    b = (W-w) * (H // 2)
    c = H * W - a - b
    MAX = max([a, b, c])
    MIN = min([a, b, c])
    if MAX - MIN <= answer:
        answer = MAX - MIN
    w += 1

a = W // 3
b = (W - a) // 2
c = W - a - ((W - a) // 2)
a *= H
b *= H
c *= H
MAX = max([a, b, c])
MIN = min([a, b, c])
if MAX - MIN <= answer:
    answer = MAX - MIN

a = H // 3
b = (H - a) // 2
c = H - a - ((H - a) // 2)
a *= W
b *= W
c *= W
MAX = max([a, b, c])
MIN = min([a, b, c])
if MAX - MIN <= answer:
    answer = MAX - MIN

print(answer)
Buggy python submission (verdict: Runtime Error):
	n, k = map(int, input().split())
a = [0] * n
b = [0] * n
sum = 0
arr = []
for i in range(n):
    a[i], b[i] = map(int, input().split())
arr_list = list(zip(a, b))
arr_list = sorted(arr_list)
# print(arr_list)
for i in range(n):
    sum += arr_list[i][1]
    # print(sum, arr_list[i])
    if sum >= k:
        answer = arr_list[i]
        break

print(answer)


Fixed submission:
n, k = map(int, input().split())
a = [0] * n
b = [0] * n
sum = 0
arr = []
for i in range(n):
    a[i], b[i] = map(int, input().split())
arr_list = list(zip(a, b))
arr_list = sorted(arr_list)
# print(arr_list)
for i in range(n):
    sum += arr_list[i][1]
    # print(sum, arr_list[i])
    if sum >= k:
        answer = arr_list[i][0]
        break

print(answer)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
stud = []
poit = []
for i in range(n):
    a, b = map(int, input().split())
    stud.append([a, b])
for i in range(n):
    c, d = map(int, input().split())
    poit.append([c, d])
for a, b in stud:
    # print(a, b)
    dist = float('inf')
    for i, info in enumerate(poit):
        c = info[0]
        d = info[1]
        mdist = abs(a-c) + abs(b-d)
        if dist > mdist:
            dist = mdist
            ans = i+1
    print(ans)
    # print(i, info)


Fixed submission:
N, M = map(int, input().split())
a = [0] * N
b = [0] * N
c = [0] * M
d = [0] * M
for i in range(N):
    a[i], b[i] = map(int, input().split())
for i in range(M):
    c[i], d[i] = map(int, input().split())

for i in range(N):
    d1 = float('inf')
    for j in range(M):
        d2 = abs(a[i] - c[j]) + abs(b[i] - d[j])
        if d1 > d2:
            d1 = d2
            check = j + 1
    print(check)

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
stud = []
poit = []
for i in range(n):
    a, b = map(int, input().split())
    stud.append([a, b])
for i in range(n):
    c, d = map(int, input().split())
    poit.append([c, d])
for a, b in stud:
    # print(a, b)
    dist = float('inf')
    ans = -1
    for i, info in enumerate(poit):
        c = info[0]
        d = info[1]
        mdist = abs(a-c) + abs(b-d)
        if dist > mdist:
            dist = mdist
            ans = i+1
    print(ans)
    # print(i, info)


Fixed submission:
N, M = map(int, input().split())
a = [0] * N
b = [0] * N
c = [0] * M
d = [0] * M
for i in range(N):
    a[i], b[i] = map(int, input().split())
for i in range(M):
    c[i], d[i] = map(int, input().split())

for i in range(N):
    d1 = float('inf')
    for j in range(M):
        d2 = abs(a[i] - c[j]) + abs(b[i] - d[j])
        if d1 > d2:
            d1 = d2
            check = j + 1
    print(check)
Buggy python submission (verdict: Time Limit Exceeded):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

N = int(input())
answer = float('inf')
max = 0
len_div = len(make_divisors(N))

if len_div % 2 == 0:
    for i in range(len_div // 2):
        A_len = len(str(make_divisors(N)[i]))
        B_len = len(str(make_divisors(N)[len_div - i - 1]))
        if A_len <= B_len:
            max = B_len
        else:
            max = A_len
        # print(A_len, B_len, max)
else:
    for i in range(len_div // 2 + 1):
        A_len = len(str(make_divisors(N)[i]))
        B_len = len(str(make_divisors(N)[len_div - i - 1]))
        # print(A_len, B_len)
        if A_len <= B_len:
            max = B_len
        else:
            max = A_len
        # print(A_len, B_len, max)

print(max)



Fixed submission:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

N = int(input())
answer = 0
len_div = len(make_divisors(N))
# print(make_divisors(N))
# print(make_divisors(N))
# print(make_divisors(N))
# print(len(make_divisors(N)))
# print(make_divisors(N)[len_div // 2])

if len_div % 2 == 0:
    A_len = len(str(make_divisors(N)[len_div // 2 - 1]))
    B_len = len(str(make_divisors(N)[len_div // 2]))
    if A_len <= B_len:
        answer = B_len
    else:
        answer = A_len
else:
    answer = len(str(make_divisors(N)[len_div // 2]))
    # print(make_divisors(N)[len_div // 2])
print(answer)
Buggy python submission (verdict: Runtime Error):
N = int(input())
mod = 10 ** 9 + 7
def fact(n):
    if n == 1:
        return 1
    return n * fact(n-1)

answer = fact(N)
print(answer % mod)

Fixed submission:
N = int(input())
mod = 10 ** 9 + 7
answer = 1
for i in range(2, N+1):
    answer *= i
    answer %= mod

print(answer)

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

def fact(n):
    if n == 1:
        return 1
    return n * fact(n-1)

answer = fact(N)
print(answer)

Fixed submission:
N = int(input())
mod = 10 ** 9 + 7
answer = 1
for i in range(2, N+1):
    answer *= i
    answer %= mod

print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
N , M = map(int, input().split())
answer = 0
if M >= 2 * N:
    M -= 2 * N
    answer = N
    if M >= 4:
        answer += M // 4
else:
    for i in range(1, N+1):
        if 2 * i < M:
            answer += 1
        else:
            break
        
print(answer)

Fixed submission:
N , M = map(int, input().split())
answer = 0
if M >= 2 * N:
    M -= 2 * N
    answer = N
    if M >= 4:
        answer += M // 4
else:
    answer += M // 2

print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
N , M = map(int, input().split())
answer = 0
if M >= 2 * N:
    M -= 2 * N
    answer = N
    if M >= 4:
        answer += M // 4
else:
    for i in range(1, N+1):
        if 2 * i < M:
            answer += 1

print(answer)

Fixed submission:
N , M = map(int, input().split())
answer = 0
if M >= 2 * N:
    M -= 2 * N
    answer = N
    if M >= 4:
        answer += M // 4
else:
    answer += M // 2

print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())
answer = 0
for X in range(K + 1):
    for Y in range(K + 1):
        for Z in range(K + 1):
            if X + Y + Z == S:
                answer += 1

print(answer)

Fixed submission:
K, S = map(int, input().split())
answer = 0

for X in range(K + 1):
    for Y in range(K + 1):
        Z = S - X - Y
        if 0 <= Z and Z <= K:
            answer += 1

print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
mod = 10 ** 9 + 7

if N % 2 == 0:
    for i in range(1, N, 2):
        if A.count(i) != 2:
            print(0)
            exit()
else:
    if A.count(0) != 1:
        print(0)
        exit()
    for i in range(2, N, 2):
        if A.count(i) != 2:
            print(0)
            exit()

print(2 ** (N // 2) % mod)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
mod = 10 ** 9 + 7

A.sort()
if N % 2 == 0:
    # print(A[0:N:2])
    # print(A[1:N+1:2])
    if A[0:N:2] != A[1:N+1:2]:
        print(0)
        exit(0)
else:
    if A[0] != 0:
        print(0)
        exit()
    if A[1:N-1:2] != A[2:N:2]:
        print(0)
        exit()

print(2 ** (N // 2) % mod)
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
C = [''] * W
for i in range(H):
    C[i] = input()

for i in range(H):
    print(C[i])
    print(C[i])

Fixed submission:
H, W = map(int, input().split())
C = [''] * H
for i in range(H):
    C[i] = input()

for i in range(H):
    print(C[i])
    print(C[i])

Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
C = [0] * W
for i in range(H):
    C[i] = input()

for i in range(H):
    print(C[i])
    print(C[i])

Fixed submission:
H, W = map(int, input().split())
C = [''] * H
for i in range(H):
    C[i] = input()

for i in range(H):
    print(C[i])
    print(C[i])
Buggy python submission (verdict: Runtime Error):
s = input()
s = s.lstrip('AtCoder ')
s = s.rstrip(' Contest ')
# print(s)
print('A' + s[0] + 'C')

Fixed submission:
a, b, c = input().split()
print(a[0] + b[0] + c[0])

Buggy python submission (verdict: Runtime Error):
s = input()
s = s.lstrip('AtCoder ')
s = s.rstrip(' Contest')
print('A' + s[0] + 'C')

Fixed submission:
a, b, c = input().split()
print(a[0] + b[0] + c[0])
Buggy python submission (verdict: Time Limit Exceeded):
x = input()
while 'ST' in x:
    # print(x)
    x = x.replace('ST', '')

print(len(x))

Fixed submission:
x = input()
n = len(x)
ans = []
for i in range(n):
    if x[i] == 'S':
        ans.append(x[i])
    else:
        if len(ans) > 0:
            if ans[-1] == 'S':
                ans.pop()
            else:
                ans.append(x[i])
        else:
            ans.append(x[i])
    # print(ans)

print(len(ans))
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if (A * B * C) % 2 == 0:
    ans = 0
else:
    V = A*B*C
    AB = A*B
    BC = B*C
    CA = C*A
    ans = min(V-(A//2)*BC, V-((A//2) + 1)*BC)
    ans = min(V-(B//2)*CA, V-((B//2) + 1)*CA)
    ans = min(V-(C//2)*AB, V-((C//2) + 1)*AB)
print(V - 2*ans)

Fixed submission:
A, B, C = map(int, input().split())
if (A * B * C) % 2 == 0:
    ans = 0
    print(ans)
else:
    ans = float('inf')
    V = A*B*C
    AB = A*B
    BC = B*C
    CA = C*A
    ans = min(ans, abs((A//2)*BC - ((A//2) + 1)*BC))
    ans = min(ans, abs((B//2)*CA - ((B//2) + 1)*CA))
    ans = min(ans, abs((C//2)*AB - ((C//2) + 1)*AB))
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, A = map(int, input().split())
x = list(map(int, input().split()))

#dp[j][k][s] = (x0...xj からk枚選んでxiの合計をsにするような選び方の総数)
dp = [[[0] * (A * N + 1) for k in range(N + 1)] for j in range(N)]

dp[0][0][0] = 1
if x[0] <= A * N:
    dp[0][1][x[0]] = 1

for j in range(N - 1):
    for k in range(N + 1):
        for s in range(A * N + 1):
            if k == 0 and s == 0:
                dp[j + 1][k][s] = 1
            elif k > j + 2:
                dp[j + 1][k][s] = 0
            elif s >= x[j + 1] and k >= 1:
                dp[j + 1][k][s] = dp[j][k][s] + dp[j][k - 1][s - x[j + 1]]
            else:
                dp[j + 1][k][s] = dp[j][k][s]

res = 0
for i in range(1, N + 1):
    res += dp[N - 1][i][A * i]

print(res)

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

#dp[j][k][s] = (x0...xj からk枚選んでxiの合計をsにするような選び方の総数)
dp = [[[0] * (A * N + 1) for k in range(N + 1)] for j in range(N)]

dp[0][0][0] = 1
if x[0] <= A * N:
    dp[0][1][x[0]] = 1

for j in range(N - 1):
    for k in range(N + 1):
        for s in range(A * N + 1):
            if k == 0 and s == 0:
                dp[j + 1][k][s] = 1
            elif k > j + 2:
                dp[j + 1][k][s] = 0
            elif s >= x[j + 1] and k >= 1:
                dp[j + 1][k][s] = dp[j][k][s] + dp[j][k - 1][s - x[j + 1]]
            else:
                dp[j + 1][k][s] = dp[j][k][s]

res = 0
for i in range(1, N + 1):
    res += dp[N - 1][i][A * i]

print(res)
Buggy python submission (verdict: Runtime Error):
# s = input()

# alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
#             'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

# alphabet_count = [0] * 26
# print(alphabet_count)
# for i in 10 ** 5:
#     for j in range(26):
#         alphabet_count[j] = s[].count(alphabet[j])
# print(alphabet_count)

import collections
import itertools

MAX_S = 100 #制約
NO_SOL = (-1, -1)

def is_unbalanced(s):
    ctr = collections.Counter(s)
    total = sum(ctr.values())
    m = max(ctr.values())
    return m >= total // 2 + 1

def find_unbalanced_substr(s):
    l = len(s)
    for start, end in itertools.combinations(range(l), 2):
        # print('start, end = ' + str(start), str(end))
        if is_unbalanced(s[start:end + 1]):
            return start, end
    return NO_SOL

def main():
    s = input()
    assert len(s) <= MAX_S
    ans = find_unbalanced_substr(s)
    if ans == NO_SOL:
        print(*ans)
    else:
        # print(ans)
        print(*(x + 1 for x in ans))

if __name__ == '__main__':
    main()

Fixed submission:
NO_SOL = (-1, -1)
 
 
# 所与の文字列の部分文字列であって、アンバランスなものを1つ探す
# 対象とするのは、"AA"および"ABA"のみ
# 結果のインデックスは0始まりである
def search_unbalanced_substr(s):
    n = len(s)
    # "AA"を探す
    for i in range(n - 1):
        if s[i] == s[i + 1]:
            return i, i + 1
    # "ABA"を探す
    for i in range(n - 2):
        if s[i] == s[i + 2]:
            return i, i + 2
    # 見つからなければ
    return NO_SOL
 
 
def main():
    ans = search_unbalanced_substr(input())
    if ans == NO_SOL:
        print(*ans)
    else:
        print(*(i + 1 for i in ans))
 
 
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

sum = 0

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

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
 
# required function 
def findProductSum(A, n): 
      
    # calculating array sum (a1 + a2 ... + an) 
    array_sum = 0
    for i in range(0, n, 1): 
        array_sum = array_sum + A[i] 
  
    # calcualting square of array sum 
    # (a1 + a2 + ... + an)^2 
    array_sum_square = array_sum * array_sum 
  
    # calcualting a1^2 + a2^2 + ... + an^2 
    individual_square_sum = 0
    for i in range(0, n, 1): 
        individual_square_sum += A[i] * A[i] 
  
    # required sum is (array_sum_square - 
    # individual_square_sum) / 2 
    return (array_sum_square - 
            individual_square_sum)
mod = 10**9+7
  
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)
  
print(modinv(2)*int(findProductSum(a, n))%mod)

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

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

sum = 0

for v in itertools.combinations(a, 2):
	sum += v[0]*v[1]
    
print(sum%(10**9+7))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
 
# required function 
def findProductSum(A, n): 
      
    # calculating array sum (a1 + a2 ... + an) 
    array_sum = 0
    for i in range(0, n, 1): 
        array_sum = array_sum + A[i] 
  
    # calcualting square of array sum 
    # (a1 + a2 + ... + an)^2 
    array_sum_square = array_sum * array_sum 
  
    # calcualting a1^2 + a2^2 + ... + an^2 
    individual_square_sum = 0
    for i in range(0, n, 1): 
        individual_square_sum += A[i] * A[i] 
  
    # required sum is (array_sum_square - 
    # individual_square_sum) / 2 
    return (array_sum_square - 
            individual_square_sum)
mod = 10**9+7
  
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)
  
print(modinv(2)*int(findProductSum(a, n))%mod)

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

sum = 0

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

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
 
# required function 
def findProductSum(A, n): 
      
    # calculating array sum (a1 + a2 ... + an) 
    array_sum = 0
    for i in range(0, n, 1): 
        array_sum = array_sum + A[i] 
  
    # calcualting square of array sum 
    # (a1 + a2 + ... + an)^2 
    array_sum_square = array_sum * array_sum 
  
    # calcualting a1^2 + a2^2 + ... + an^2 
    individual_square_sum = 0
    for i in range(0, n, 1): 
        individual_square_sum += A[i] * A[i] 
  
    # required sum is (array_sum_square - 
    # individual_square_sum) / 2 
    return (array_sum_square - 
            individual_square_sum)
mod = 10**9+7
  
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)
  
print(modinv(2)*int(findProductSum(a, n))%mod)
Buggy python submission (verdict: Runtime Error):
# union-find

import collections

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

list = [list(map(int, input().split())) for x in range(m)]

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

for i in list:
    par[i[0]] = i[1]

def find(x):
    if par[x] == x:
        return x
    else:
        par[x] = find(par[x]) #経路圧縮
        return par[x]
      
for i in range(len(par)):
    find(i)

c = collections.Counter(par)

print(c.most_common()[0][1])


Fixed submission:
# union-find

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

list = [list(map(int, input().split())) for x in range(m)]

#Union Find

#xの根を求める
def find(x):
    if par[x] < 0:
        return x
    else:
        par[x] = find(par[x])
        return par[x]
#xとyの属する集合の併合
def unite(x,y):
    x = find(x)
    y = find(y)

    if x == y:
        return False
    else:
        #sizeの大きいほうがx
        if par[x] > par[y]:
            x,y = y,x
        par[x] += par[y]
        par[y] = x
        return True

#xとyが同じ集合に属するかの判定
def same(x,y):
    return find(x) == find(y)

#xが属する集合の個数
def size(x):
    return -par[find(x)]

#初期化
#根なら-size,子なら親の頂点
par = [-1]*n

for i in list:
  unite(i[0]-1, i[1]-1)

max = 0

for i in range(len(par)):
    if max<size(i):
        max = size(i)
print(max)
Buggy python submission (verdict: Runtime Error):
n = int(input())
c = input()

wcount = c.count('R')
count = 0

for i in range(n):
    if c[i] == 'W' and i<= wcount:
        count += 1
print(count)


Fixed submission:
x = int(input())

if x >= 30:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
c = list(map(int, input().split()))[0]
n, d = c[0], c[0]

xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]

count = 0

for i in range(n-1):
    a = x[i]*x[i] + y[i]*y[i]
    if a <= d*d:
        count += 1
print(count)


Fixed submission:
c = list(map(int, input().split()))
n, d = c[0], c[1]

xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]

count = 0

for l in range(n):
    a = x[l]*x[l] + y[l]*y[l]
    if a <= d*d:
        count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
n = list(map(int, input().split()))[0]
d = list(map(int, input().split()))[1]

xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]

count = 0

for i in range(n):
    if x[i]*x[i] + y[i]*y[i] <= d*d:
        count += 1
print(count)

Fixed submission:
c = list(map(int, input().split()))
n, d = c[0], c[1]

xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]

count = 0

for l in range(n):
    a = x[l]*x[l] + y[l]*y[l]
    if a <= d*d:
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
a = 7
b = int(inout())

list = [7]
for i in range(b):
    list.append(list[-1]*10 +7)

for l in range(len(list)):
    if list[l] % b == 0:
        print(l+1)
        exit()


Fixed submission:
s = 7
a = int(input())

for i in range(10**6):
    if s%a == 0:
        print(i+1)
        exit()
    s = (s*10+7) % a
print(-1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

money = 1000
for i in range(n-1):
    if a[i] < a[i+1]:
        money += (a[i+1]-a[i])*(money//a[i])
print(money)

Fixed submission:
a = int(input())

if 600 > a >= 400:
    print(8)
elif 800 > a >= 600:
    print(7)
elif 1000 > a >= 800:
    print(6)
elif 1200 > a >= 1000:
    print(5)
elif 1400 > a >= 1200:
    print(4)
elif 1600 > a >= 1400:
    print(3)
elif 1800 > a >= 1600:
    print(2)
elif 2000 > a >= 1800:
    print(1)
Buggy python submission (verdict: Runtime Error):
a = list(map(int, input().split()))
k = int(input())
count = 0

while a[1] <= a[0]:
    a[1] = a[1]*2
    count += 1
while a[2] <= a[1]:
    a[2] = a[2]*2
    count += 1

if count > k:
    print(no)
else:
    print(yes)

Fixed submission:
a = list(map(int, input().split()))
k = int(input())
count = 0

while a[1] <= a[0]:
    a[1] = a[1]*2
    count += 1
while a[2] <= a[1]:
    a[2] = a[2]*2
    count += 1

if count > k:
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int, input().split()))
b = list(map(int, input().split()))

list = []
count = 1

for i in range(a[0]-a[1]+1):  # 始まりの位置
    for j in range(a[1]):
        count *= b[i+j]
    list.append(count)
    count = 1
for i in range(len(list)-1):
    if list[i+1] > list[i]:
        print('Yes')
    else:
        print('No')


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

for i in range(k,n):
    if a[i] > a[i-k]:
        print('Yes')
    else:
        print('No')