Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
H,A = map(int,input().split())
answer = H // A
if answer == 0
	answer += 1
print(answer)

Fixed submission:
H,A = map(int,input().split())
answer = H // A + 1
if H % A == 0:
	answer -= 1
print(answer)
Buggy python submission (verdict: Runtime Error):
c = input()
al = ['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']
i = al.find('c')
print(al[i+1])

Fixed submission:
c = input()
al = ['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']
t = 0
for i in range(26):
    if c == al[i]:
        t = i
print(al[t+1])
Buggy python submission (verdict: Time Limit Exceeded):
H, W = map(int, input().split())
maze = [input() for i in range(H)]
start_candidate = []
'''
. , #
'''

from collections import deque

direction = [
    (-1, 0),
    (0, -1),
    (1, 0),
    (0, 1)
]


def bfs(si, sj, gi, gj):
    reached = [[-1] * W for i in range(H)]
    reached[si][sj] = 0
    que = deque([[si, sj]])
    while que:
        i, j = que.popleft()
        for vi, vj in direction:
            ti, tj = i + vi, j + vj
            if ti < 0 or tj < 0 or ti > H - 1 or tj > W - 1:
                continue
            if maze[ti][tj] == '#' or reached[ti][tj] != -1:
                continue
            reached[ti][tj] = reached[i][j] + 1
            que.append([ti, tj])
        if reached[gi][gj] != -1:
            break
    return reached[gi][gj]


for i in range(H):
    for j in range(W):
        if maze[i][j] != '#':
            start_candidate.append([i, j])

from itertools import combinations

ans = 0
for c in combinations(start_candidate, 2):
    ans = max(ans, bfs(c[0][0], c[0][1], c[1][0], c[1][1]))
print(ans)


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

direction = [
    (0, 1),
    (1, 0),
    (-1, 0),
    (0, -1)
]


def bfs(sy, sx):
    reached = [[-1] * W for _ in range(H)]
    reached[sy][sx] = 0
    from collections import deque
    que = deque([[sy, sx]])
    #d_max = 0
    while que:
        iy, ix = que.popleft()
        for d in direction:
            tx, ty = ix + d[0], iy + d[1]
            if tx >= W or ty >= H or tx < 0 or ty < 0:
                continue
            if reached[ty][tx] != -1 or maze[ty][tx] == '#':
                continue
            reached[ty][tx] = reached[iy][ix] + 1
            #d_max = max(reached[ty][tx], d_max)
            que.append([ty, tx])
    d_max = 0
    for i in range(H):
        for j in range(W):
            d_max = max(d_max,reached[i][j])

    return d_max


ans = 0

for i in range(H):
    for j in range(W):
        if maze[i][j] == '.':
            ans = max(ans, bfs(i, j))

# for i in range(H):
#     for j in range(i, W):
#         for k in range(H):
#             for l in range(k, W):
#                 if maze[i][j] == '#' or maze[k][l] == '#':
#                     continue
#                 else:
#                     ans = max(ans, bfs(i, j, k, l))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
N = input()
S = input()

com = list(set([c[0]+c[1]+c[2] for c in itertools.combinations(S,3)]))
#com = list(set([c[0]+c[1]+c[2] for c in itertools.combinations(N,3)]))
print(len(com))

Fixed submission:
import itertools
N = input()
S = input()

#com = list(set([c[0]+c[1]+c[2] for c in itertools.combinations(S,3)]))
#com = list(set([c[0]+c[1]+c[2] for c in itertools.combinations(N,3)]))
#print(len(com))


# X1_list = [int(input()) for i in range(N)]
# X2_list = [list(map(int,input().split())) for i in range(N)]
result = 0

for i in range(0,1000):
    s = str(i).zfill(3)
    #print(s[0] + '\d' + s[1] + '\d' + s[2])
    #pattern = '\d' + s[0] + '*\d' + s[1] + '*\d' + s[2] + '*\d'
    #import re
    #repattern = re.compile(pattern)
    #result = repattern.match(S)
    first_index = S.find(s[0])
    if first_index == -1:
        continue
    S_1 = S[first_index+1:]
    second_index = S_1.find(s[1])
    if second_index == -1:
        continue
    S_2 = S_1[second_index+1:]
    third_index = S_2.find(s[2])
    if third_index == -1:
        continue
    result += 1
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L_list =  sorted(list(map(int,input().split())),reverse=True)
#print(L_list)
result =0

for i in range(N):
    for j in range(i+1,N):
        if L_list[i] > L_list[j] * 2:
            break
        for k in range(j+1,N):
            if L_list[i] >= L_list[j] + L_list[k]:
                break
            elif L_list[i] < L_list[j] + L_list[k] and \
                    L_list[j] < L_list[k] + L_list[i] and \
                    L_list[k] < L_list[i] + L_list[j]:
                #print(i,j,k)
                result += 1
print(result)

Fixed submission:
import bisect
N = int(input())
L_list =  sorted(list(map(int,input().split())))
#print(L_list)
result =0

for i in range(N):
    for j in range(i+1,N):
        a = L_list[i] + L_list[j]
        idx = bisect.bisect_left(L_list,a)
        result += max(0,idx-j-1)
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L_list = list(map(int,input().split()))
L_list = sorted(L_list,reverse=True)
#print(L_list)
result =0
for i in range(N):
    for j in range(i+1,N):
        for k in range(j+1,N):
            if L_list[i] < L_list[j] + L_list[k] and \
                    L_list[j] < L_list[k] + L_list[i] and \
                    L_list[k] < L_list[i] + L_list[j]:
                #print(i,j,k)
                result += 1
            elif L_list[i] >= L_list[j] + L_list[k] or \
                    L_list[j] >= L_list[k] + L_list[i]:
                    break
print(result)

Fixed submission:
import bisect
N = int(input())
L_list =  sorted(list(map(int,input().split())))
#print(L_list)
result =0

for i in range(N):
    for j in range(i+1,N):
        a = L_list[i] + L_list[j]
        idx = bisect.bisect_left(L_list,a)
        result += max(0,idx-j-1)
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
def cf(x1,x2):
    cf=[]
    for i in range(2,min(x1,x2)+1):
        if x1 % i == 0 and x2 % i == 0:
            cf.append(i)
    return cf
def main():
    a,b = map(int, input().split())
    c = cf(a,b)
    c.append(1)
    list_cf = sorted(c)
    list_ans = []*len(list_cf)
    for i in range(len(list_cf)):
        for j in range(i+1,len(list_cf)):
            if list_cf[i] != 1 and cf(list_cf[j],list_cf[i])!=0 and list_cf[j]%list_cf[i]==0:
                list_ans.append(list_cf[j])
    print(len(list_cf)-len(list(set(list_ans))))
if __name__ == "__main__":
    main()

Fixed submission:
A, B = map(int, input().split())


def prime_numbers(N):
    n = N
    res = set()
    for i in range(2, n):
        if i * i >= n: break
        if N % i != 0: continue
        while N % i == 0:
            N //= i
        res.add(i)
    res.add(N)
    res.add(1)
    return res


a = prime_numbers(A)
b = prime_numbers(B)
#print(a, b)
#print(a.intersection(b))
ans = len(a.intersection(b))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
#S = input()
N,M = map(int,input().split())
A_list = list(map(int,input().split()))
#X1_list = [int(input()) for i in range(N)]
#X2_list = [list(map(int,input().split())) for i in range(N)]

for i in range(M):
    A_list.sort(reverse=True)
    A_list[0] = A_list[0]//2
print(sum(A_list))

Fixed submission:
from heapq import heappush, heappop,heapify
N,M = map(int,input().split())


A_list = list(map(lambda a : -int(a),input().split()))
#print(A_list)
heapify(A_list)
#print(-heappop(A_list))
for i in range(M):
    tmp = -heappop(A_list)//2
    heappush(A_list,-tmp)
print(-sum(A_list))

'''
3 3 
8 6 5
4 4
8 7 6 5 
10 6
10 7 6 5 8 9 10 11 12 13
'''
Buggy python submission (verdict: Time Limit Exceeded):
#K,X = map(int,input().split())
N = int(input())
S = [''.join(sorted(input())) for i in range(N)]
result = 0
for i in range(N):
    for j in range(i+1,N):
        if S[i] == S[j]:
            result += 1
print(result)


Fixed submission:
from collections import Counter
#K,X = map(int,input().split())
N = int(input())
S = [''.join(sorted(input())) for i in range(N)]
result = 0
c = {}
for s in S:
    if c.get(s) is None:
        #print('None')
        c[s] = 1
    else:
        result += c[s]
        c[s] += 1
print(result)
Buggy python submission (verdict: Runtime Error):
N = int(input())
AB_list = [list(map(int, input().split())) for i in range(N)]

kouho_list = []

for i, AB in enumerate(AB_list):
    for j,ab in enumerate(AB_list[i+1:]):
        kouho_list.append((AB[0]-ab[0] ,AB[1]-ab[1]))

from collections import Counter
kouho_counter = Counter(kouho_list).most_common()
#print(kouho_counter)
result = len(AB_list) - kouho_counter[0][1]

'''
候補は49 + 48 + 47 + ...
この候補の中で、一番えらばれているものをp,qとして設定する
その後、ループを回して、実際にコストを計算する

'''



#print(AB_list)
print(result)

Fixed submission:
N = int(input())
AB_list = [list(map(int, input().split())) for i in range(N)]

if len(AB_list) ==1:
    print(1)
    exit(0)

AB_list = sorted(AB_list,key=lambda a:a[0])
kouho_list = []
for i, AB in enumerate(AB_list):
    for j,ab in enumerate(AB_list):
        if i == j:
            continue
        kouho_list.append((ab[0]-AB[0] ,ab[1]-AB[1]))

from collections import Counter
kouho_counter = Counter(kouho_list).most_common()
pq = list(kouho_counter[0][0])

onaji_list = []
#print(kouho_counter)

result = []
for i,ab in enumerate(AB_list):
    for j,ab2 in enumerate(AB_list):
        if i == j:
            continue
        if ab[0] + pq[0] == ab2[0] and ab[1] + pq[1] == ab2[1]:
            result.append(tuple(ab2))
            continue
        #if ab[0] - pq[0] == ab2[0] and ab[1] - pq[1] == ab2[1]:
            #result.append(tuple(ab2))


#print(result)
result = list(set(result))
#print(onaji_list)
#print(result)
print(len(AB_list)-len(result))





'''
候補は49 + 48 + 47 + ...
この候補の中で、一番えらばれているものをp,qとして設定する
その後、ループを回して、実際にコストを計算する

'''


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

N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
temp = itertools.product([0, 1], repeat=N)
ans = 0
for T in temp:
    an = 0
    for i, e in enumerate(T):
        if e == 1:
            an += V[i] - C[i]
    ans = max(ans,an)
print(ans)


Fixed submission:
import itertools

N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
temp = itertools.product([0, 1], repeat=N)
ans = 0
for T in temp:
    an = 0
    for i, e in enumerate(T):
        if e == 1:
            an += V[i] - C[i]
    ans = max(ans,an)
print(ans)
Buggy python submission (verdict: Runtime Error):
import math

n = list(map(int, input().split()))
A = list(map(int, input().split()))
a_max = max(A)
result = []
for a in A:
    result.append(math.gcd(a_max,a))

result.sort(reverse=True)

print(result[1])

Fixed submission:
import fractions


'''

最大公約数を求める
最大公約数を最大にするには何を変えれば良いか

最大値との最大公約数を求めて、最大になれば良い?

'''

n = list(map(int, input().split()))
A = list(map(int, input().split()))
right = []
left = []
for i,a in enumerate(A):
    if i ==0 :
        right.append(a)
    else:
        right.append(fractions.gcd(right[i-1],a))

for i,b in enumerate(reversed(A)):
    if i ==0 :
        left.append(b)
    else:
        left.append(fractions.gcd(left[i-1],b))

result = []

for i,r in enumerate(A):
    if i ==0:
        result.append(right[len(right)- 2])
    if i == len(A) -1:
        result.append(left[len(left) - 2])

    result.append(fractions.gcd(left[i -1], right[len(right) - i -2]))

print(max(result))
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()

shiro_num = s.count(".")
kuro_num = n - shiro_num

right_kuro_num = kuro_num
right_siro_num = shiro_num

result = shiro_num

for e in s:
    if e == '.':
        right_siro_num -= 1
    else:
        right_kuro_num -= 1
    num = right_siro_num + kuro_num - right_kuro_num
    result = min(num,result)

print(result)

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

result = 'Yes'
t = min(a,b)
u = max(a,b)
if c > t and c < u:
    print(result)
else :
    result = 'No'
    print(result)
Buggy python submission (verdict: Runtime Error):
q, k = list(map(int, input().split()))
list = [int(i) for i in input()]

# 0 ,1 のまとまりを作る
sum01 = []
pre = 1
cnt = 0
# 111010
# 001010
for i, e in enumerate(list):
    if e != pre:
        sum01.append(cnt)
        cnt = 1
        pre = e
    else:
        cnt += 1
if cnt != 0:
    sum01.append(cnt)

if len(sum01) % 2 == 1:
    sum01.append(0)

# print(sum01)
Add = 2 * k + 1
ruiseki = [0]
for i, e in enumerate(sum01):
    ruiseki.append(ruiseki[i] + sum01[i])

# print(ruiseki)
answer = 0
for i in range(0, len(ruiseki), 2):
    left = i
    right = min(i + Add, len(sum01))
    temp = ruiseki[right] - ruiseki[left]
    answer = max(temp, answer)

Fixed submission:
n = list(map(int, input().split()))
if n[0] == n[1]:
    print(n[0] * 2)
else:
    print(max(n) + max(n) - 1)
Buggy python submission (verdict: Runtime Error):
a, b, c, d, e, k = (int(i) for i in int(input()))
city = (d, c, b, a)
result = 'Yay!'
for i, c in enumerate(city):
    for cC in city.index(i + 1, city.count()):
        if (c - cC) > k:
            result = ':('
            break;
print(result)


Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

city = [e,d, c, b, a]
result = 'Yay!'
for i, c in enumerate(city):
    for cC in city[i + 1:len(city)]:
        if (c - cC) > k:
            result = ':('
            break;
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()
LR = [list(map(int, input().split())) for i in range(Q)]

ans_cnt = 0
ans_idx = []
for i in range(1, N):
    if S[i - 1] + S[i] == 'AC':
        ans_cnt += 1
        ans_idx.append(i)

#print(ans_idx)
for lr in LR:
    cnt = 0
    for idx in ans_idx:
        if lr[0] <= idx < lr[1]:
            cnt += 1
        if lr[1] <= idx:
            break
    print(cnt)


Fixed submission:
N, Q = map(int, input().split())
S = input()
t = [0] * (N + 1)
for i in range(N):
    t[i + 1] = t[i] + (1 if S[i : i + 2] == 'AC' else 0)
#print(t)
for i in range(Q):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])
Buggy python submission (verdict: Runtime Error):
import fractions

A, B, K = list(map(int, input().split()))

a_re = []
b_re = []

for i in range(max(A,B)//2 +1):
    if i == 0:
        continue
    if A % i ==0:
        a_re.append(i)
    if B % i ==0:
        b_re.append(i)

result = list (set(a_re) & set( b_re))
if len(result) == 0:
    print(1)
    exit(0)

result.sort(reverse=True)
print(result[K-1])


Fixed submission:
import fractions

A, B, K = list(map(int, input().split()))

a_re = []
b_re = []

for i in range(max(A,B) + 1):
    if i == 0:
        continue
    #print(i)
    if A % i ==0:
        a_re.append(i)
    if B % i ==0:
        b_re.append(i)
#print(a_re)

result = list (set(a_re) & set( b_re))

result.sort(reverse=True)
print(result[K-1])

Buggy python submission (verdict: Runtime Error):
import fractions

A, B, K = list(map(int, input().split()))

a_re = []
b_re = []

for i in range(max(A,B)//2 +1):
    if i == 0:
        continue
    if A % i ==0:
        a_re.append(i)
    if B % i ==0:
        b_re.append(i)

result = list (set(a_re) & set( b_re))
result.sort(reverse=True)

#print(result)
print(result[K-1])


Fixed submission:
import fractions

A, B, K = list(map(int, input().split()))

a_re = []
b_re = []

for i in range(max(A,B) + 1):
    if i == 0:
        continue
    #print(i)
    if A % i ==0:
        a_re.append(i)
    if B % i ==0:
        b_re.append(i)
#print(a_re)

result = list (set(a_re) & set( b_re))

result.sort(reverse=True)
print(result[K-1])

Buggy python submission (verdict: Runtime Error):
import fractions

A, B, K = list(map(int, input().split()))

a_re = []
b_re = []

for i in range(max(A,B)//2 +1):
    if i == 0:
        continue
    if A % i ==0:
        a_re.append(i)
    if B % i ==0:
        b_re.append(i)

result = list (set(a_re) & set( b_re))
result.sort(reverse=True)

print(result)
print(result[K-1])

Fixed submission:
import fractions

A, B, K = list(map(int, input().split()))

a_re = []
b_re = []

for i in range(max(A,B) + 1):
    if i == 0:
        continue
    #print(i)
    if A % i ==0:
        a_re.append(i)
    if B % i ==0:
        b_re.append(i)
#print(a_re)

result = list (set(a_re) & set( b_re))

result.sort(reverse=True)
print(result[K-1])
Buggy python submission (verdict: Runtime Error):
C = [int(i) for i in input()]

pre = len(C)

def recursive(list):
    if len(list) == 0:
        return []
    for i,l in enumerate(list):
        if i == len(list) -1:
            break
        if (list[i] ==0 and list[i + 1] == 1) or (list[i] ==1 and list[i +1 ] ==0 ):
            #print(list)
            list.pop(i)
            list.pop(i)
            recursive(list)

recursive(C)
print(pre -len(C))



Fixed submission:
C = [int(i) for i in input()]

zero_cnt = C.count(0)
one_cnt = C.count(1)
print(min(zero_cnt,one_cnt) *2)

Buggy python submission (verdict: Runtime Error):
C = [int(i) for i in input()]

def recursive(list):
    if len(list) == 0:
        return []
    for i,l in enumerate(list):
        if i == len(list) -1:
            break
        if list[i] ==0 and list[i + 1] == 1:
            list.pop(i)
            list.pop(i)
            recursive(list)

recursive(C)
print(len(C))



Fixed submission:
C = [int(i) for i in input()]

zero_cnt = C.count(0)
one_cnt = C.count(1)
print(min(zero_cnt,one_cnt) *2)
Buggy python submission (verdict: Runtime Error):
import bisect

INF = 10 ** 9
A, B, Q = map(int, input().split())
shrine_list = [-INF] + [int(input()) for i in range(A)] + [INF]
temple_list = [-INF] + [int(input()) for i in range(B)] + [INF]
question_list = [int(input()) for i in range(Q)]

for q in question_list:
    b, d = bisect.bisect_right(shrine_list, q), bisect.bisect_right(temple_list, q)
    ans = INF
    for s in [shrine_list[b - 1], shrine_list[b]]:
        for t in [temple_list[d - 1], temple_list[d]]:
            ans = min(abs(q - s) + abs(t - s), abs(q - t) + abs(s - t), ans)
    print(ans)

Fixed submission:
import bisect

INF = 10 ** 18
A, B, Q = map(int, input().split())
shrine_list = [-INF] + [int(input()) for i in range(A)] + [INF]
temple_list = [-INF] + [int(input()) for i in range(B)] + [INF]
question_list = [int(input()) for i in range(Q)]
for q in question_list:
    b, d = bisect.bisect_right(shrine_list, q), bisect.bisect_right(temple_list, q)
    ans = INF
    for s in [shrine_list[b - 1], shrine_list[b]]:
        for t in [temple_list[d - 1], temple_list[d]]:
            ans = min(abs(q - s) + abs(t - s), abs(q - t) + abs(s - t), ans)
    print(ans)

'''
二分検索
深さ優先検索
幅優先検索
累積和
尺取法
動的計画法
mod
XOR
データ構造
'''
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

result = A
while True:
    result = list(set(result))
    result.sort()
    if min(result) == 0:
        result.remove(0)
    tmp_min = min(result)
    result =[r % tmp_min for r in result[1:]]
    #print(result)
    if max(result) == 0:
        result.append(tmp_min)
        break
    result.append(tmp_min)
    #print(result)

print(max(result))


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

result = A
while True:
    result = list(set(result))
    result.sort()
    if min(result) == 0:
        result.remove(0)
    tmp_min = min(result)
    #print(result)
    if len(result) == 1:
        break
    result =[r % tmp_min for r in result[1:]]
    #print(result)
    if max(result) == 0:
        result.append(tmp_min)
        break
    result.append(tmp_min)
    #print(result)

print(max(result))
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
H_list = list(map(int, input().split()))
INF = 1 << 100
dp = [INF] * N
dp[0] = 0
for i in range(1, N):
    for j in range(1, K + 1):
        if i - j < 0: break
        #print(dp,i,j)
        #print(abs(H_list[i] - H_list[i - j]))
        dp[i] = min(dp[i - j] + abs(H_list[i] - H_list[i - j]), dp[i])
print(dp[N-1])

Fixed submission:
N, K = map(int, input().split())
H_list = list(map(int, input().split()))
INF = 1 << 100
dp = [INF] * N
dp[0] = 0
for i in range(1, N):
    for j in range(1, K + 1):
        if i - j < 0: break
        #print(dp,i,j)
        #print(abs(H_list[i] - H_list[i - j]))
        dp[i] = min(dp[i - j] + abs(H_list[i] - H_list[i - j]), dp[i])
print(dp[N-1])
Buggy python submission (verdict: Time Limit Exceeded):
N, W = map(int, input().split())
w, v = [0] * (N + 1), [0] * (N + 1)
for i in range(1, N + 1):
    w[i], v[i] = map(int, input().split())

dp = [[0] * (W + 1) for i in range(N + 1)]

for i in range(1, N + 1):
    for j in range(1, W + 1):
        dp[i][j] = dp[i - 1][j]
        if j - w[i] >= 0: dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - w[i]] + v[i])
        #print(dp)
print(dp[N][W])

Fixed submission:
N, W = map(int, input().split())
w, v = [0] * (N + 1), [0] * (N + 1)
for i in range(1, N + 1):
    w[i], v[i] = map(int, input().split())

dp = [[0] * (W + 1) for i in range(N + 1)]

for i in range(1, N + 1):
    for j in range(1, W + 1):
        dp[i][j] = dp[i - 1][j]
        if j - w[i] >= 0: dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - w[i]] + v[i])
        #print(dp)
print(dp[N][W])
Buggy python submission (verdict: Runtime Error):
N = int(input())
T, A = map(int, input().split())
H_list = list(map(int, input().split()))

pre = A
'''
3
21 -11
81234 52141 94124
'''
for i, h in enumerate(H_list):
    if i == 0:
        ans = i
        pre = T - h * 0.006
        continue
    kion = T - h * 0.006
    if abs(A - kion) < abs(A - pre):
        #print(kion)
        #print(pre)
        #print(abs(A - kion),'kion')
        #print(abs(A - pre),'pre')
        ans = i
print(ans + 1)

Fixed submission:
X, Y = map(int,input().split())
print(X + Y//2)
Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
X_list = list(map(int, input().split()))
X_list.append(X)
X_list.sort()
kyori_list = []
for i, x in enumerate(X_list):
    if i == len(X_list) - 1:
        break
    kyori_list.append(X_list[i + 1] - x)

import math
from functools import reduce

def gcd_list(*numbers):
    return reduce(math.gcd, numbers)


print(gcd_list(*kyori_list))
# print(X_list)

Fixed submission:
N, X = map(int, input().split())
X_list = list(map(int, input().split()))
X_list.append(X)
X_list.sort()
kyori_list = []
for i, x in enumerate(X_list):
    if i == len(X_list) - 1:
        break
    kyori_list.append(X_list[i + 1] - x)

import fractions
from functools import reduce


def gcd_list(*numbers):
    return reduce(fractions.gcd, numbers)


print(gcd_list(*kyori_list))

Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
X_list = list(map(int, input().split()))
X_list.append(X)
X_list.sort()
kyori_list = []
for i, x in enumerate(X_list):
    if i == len(X_list) - 1:
        break
    kyori_list.append(X_list[i + 1] - x)

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)


print(gcd(*kyori_list))
# print(X_list)

Fixed submission:
N, X = map(int, input().split())
X_list = list(map(int, input().split()))
X_list.append(X)
X_list.sort()
kyori_list = []
for i, x in enumerate(X_list):
    if i == len(X_list) - 1:
        break
    kyori_list.append(X_list[i + 1] - x)

import fractions
from functools import reduce


def gcd_list(*numbers):
    return reduce(fractions.gcd, numbers)


print(gcd_list(*kyori_list))
Buggy python submission (verdict: Runtime Error):
S = int(input())
ans = 0
for s in S:
    if s == '+':
        ans += 1
    else:
        ans -= 1
print(ans)



Fixed submission:
S = input()
result = 0
for s in S:
    if s == '+':
        result += 1
    else:
        result -= 1
print(result)