Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math
x, y = map(int, input().split())
a = (2 * y - x) / 3
b = (2 * x - y) / 3
ans = 0
if a.is_integer() and b.is_integer():
    m = math.factorial(a + b)
    n = math.factorial(a) * math.factorial(b)
    ans = m // n
    ans %= 10 ** 9 + 7
print(ans)

Fixed submission:
x, y = map(int, input().split())
a = (2 * y - x) / 3
b = (2 * x - y) / 3

def cmb(n, r, mod):
    if (r < 0 or r > n):
        return 0
    r = min(r, n - r)
    return g1[n] * g2[r] * g2[n - r] % mod

mod = 10 ** 9 + 7
N = 10 ** 6
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]

for i in range(2, N + 1):
    g1.append((g1[-1] * i) % mod)
    inverse.append((-inverse[mod % i] * (mod // i)) % mod)
    g2.append((g2[-1] * inverse[-1]) % mod)

if a.is_integer() and b.is_integer():
    a = int(a)
    c = int(a + b)
    print(cmb(c, a, mod))
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n % 2 == 0:
    print((n / 2) / n)
elif:
    print(((n + 1) / 2) / n)
    
    

Fixed submission:
n = int(input())
print((n // 2 + n % 2) / n)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = [int(i) for i in input().split()]
ans = 0
for j in h:
    for j >= k:
        ans += 1
print(ans)

Fixed submission:
n, k = map(int, input().split())
h = [int(i) for i in input().split()]
ans = 0
for j in h:
    if j >= k:
        ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = [int(i) for i in range(n)]
ans = 0
for j in h:
    for j >= k:
        ans += 1
print(ans)

Fixed submission:
n, k = map(int, input().split())
h = [int(i) for i in input().split()]
ans = 0
for j in h:
    if j >= k:
        ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = [int(input()) for _ in range(n)]
ans = 0
for i in h:
    for i >= k:
        ans += 1
print(ans)

Fixed submission:
n, k = map(int, input().split())
h = [int(i) for i in input().split()]
ans = 0
for j in h:
    if j >= k:
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n, k, q = map(int, input().split())
point = [k - q] * n

for i in range(q):
    answer = int(input())
    point[answer - 1} += 1

for j in point:
    if j <= 0:
        print('No')
    else:
        print('Yes')

Fixed submission:
n, k, q = map(int, input().split())
point = [k - q] * n

for i in range(q):
    answer = int(input())
    point[answer - 1] += 1

for j in point:
    if j <= 0:
        print('No')
    else:
        print('Yes')

Buggy python submission (verdict: Runtime Error):
n, k, q = map(int, input().split())
point = [k - q] * n

for i in range(q):
    answer = int(input())
    point[answer - 1} += 1

for j in point:
    if p <= 0:
        print('No')
    else:
        print('Yes')

Fixed submission:
n, k, q = map(int, input().split())
point = [k - q] * n

for i in range(q):
    answer = int(input())
    point[answer - 1] += 1

for j in point:
    if j <= 0:
        print('No')
    else:
        print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
al = list(map(int, input().split()))
for i in range(m):
  al.sort()
  al[n - 1] //= 2
print(sum(al))

Fixed submission:
import heapq
n, m = map(int, input().split())
al = list(map(lambda x: (-1) * int(x), input().split()))
heapq.heapify(al)

for _ in range(m):
    al_min = heapq.heappop(al)
    heapq.heappush(al, (-1) * (-al_min // 2))

print(-sum(al))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for _ in range(n)]
for i in range(n):
    tmp = a[i]
    a[i] = 0
    print(max(a))
    a[i] = tmp

Fixed submission:
n = int(input())
aaa = [int(input()) for _ in range(n)]
max_a = sorted(aaa)[-1]
second_a = sorted(aaa)[-2]
for a in aaa:
    if a == max_a:
        print(second_a)
    if a != max_a:
        print(max_a)
Buggy python submission (verdict: Runtime Error):
n, d = map(int, input().split())
x = [[int(j) for j in input().split()] for i in range(n)]
ans = 0
for i in range(n):
    for j in range(i + 1, n):
        acum = 0.0
        for k in range(d)
            acum += (x[j][k] - x[i][k]) ** 2
        if (acum ** 0.5).is_integer():
            ans += 1
print(ans)

Fixed submission:
n, d = map(int, input().split())
x = [[int(j) for j in input().split()] for i in range(n)]
ans = 0
for i in range(n):
    for j in range(i + 1, n):
        acum = 0.0
        for k in range(d):
            acum += (x[j][k] - x[i][k]) ** 2
        if (acum ** 0.5).is_integer():
            ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = [int(i) for i in input().split()]
ctn = 0
for j in range(1, n-1):
    if p[j - 1] < p[j] < p[j + 1] or p[j + 1] < p[j] < p[j - 1]:
        ctn += 1
print(ctn)

Fixed submission:
s = str(input())
if len(set(s)) == 2:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
s = str(input())
l = set(list(s))
if range(l) == 2:
  print("Yes")
else:
  print("No")

Fixed submission:
s = str(input())
if len(set(s)) == 2:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = [int(i) for i in input().split()]
ctn = 0
for j in range(1, n-2):
    if p[j -1] < p[j] < p[j + 1]
        ctn += 1
print(ctn)

Fixed submission:
n = int(input())
p = [int(i) for i in input().split()]
ctn = 0
for j in range(1, n-1):
    if p[j - 1] < p[j] < p[j + 1] or p[j + 1] < p[j] < p[j - 1]:
        ctn += 1
print(ctn)
Buggy python submission (verdict: Runtime Error):
n, l = map(int, input().split())
a = range(l. l + n)
print(sum(a) - min(a, key=abs))

Fixed submission:
n, l = map(int, input().split())
a = range(l, l + n)
print(sum(a) - min(a, key=abs))
Buggy python submission (verdict: Runtime Error):
n = int(input())
w = [map(int, input().split())]
ans = float('inf')
for i in range(n):
    s1 = sum(w[:i])
    s2 = sum(w[i:])
    z = int(abs(s1 - s2))
    ans = min(ans, z)
print(ans)

Fixed submission:
n = int(input())
w = list(map(int, input().split()))
ans = float('inf')
for i in range(n):
    s1 = sum(w[:i])
    s2 = sum(w[i:])
    z = abs(s1 - s2)
    ans = min(ans, z)
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
w = [map(int, input().split())]
ans = 0
for i in range(n):
    s1 = sum(w[:i])
    s2 = sum(w[i:])
    z = int(abs(s1 - s2))
    ans = min(ans, z)
print(ans)


Fixed submission:
n = int(input())
w = list(map(int, input().split()))
ans = float('inf')
for i in range(n):
    s1 = sum(w[:i])
    s2 = sum(w[i:])
    z = abs(s1 - s2)
    ans = min(ans, z)
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
w = [map(int, input().split())]
ans = 0
for i in range(n):
    s1 = sum(w[:i])
    s2 = sum(w[i:])
    z = abs(s1 - s2)
    ans = min(ans, z)
print(ans)


Fixed submission:
n = int(input())
w = list(map(int, input().split()))
ans = float('inf')
for i in range(n):
    s1 = sum(w[:i])
    s2 = sum(w[i:])
    z = abs(s1 - s2)
    ans = min(ans, z)
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
w = input().split()
s1 = w[0]
s2 = w[n-1]
for i in range(1, n-2):
    if s1 < s2:
        s1 += w[i]
    else:
        s2 += w[-i-1]
print(abs(s1 - s2))


Fixed submission:
n = int(input())
w = list(map(int, input().split()))
ans = float('inf')
for i in range(n):
    s1 = sum(w[:i])
    s2 = sum(w[i:])
    z = abs(s1 - s2)
    ans = min(ans, z)
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
w = [map(int, input().split())]
s1 = w[0]
s2 = w[n-1]
for i in range(1, n-2):
    if s1 < s2:
        s1 += w[i]
    else:
        s2 += w[-i-1]
print(abs(s1 - s2))


Fixed submission:
n = int(input())
w = list(map(int, input().split()))
ans = float('inf')
for i in range(n):
    s1 = sum(w[:i])
    s2 = sum(w[i:])
    z = abs(s1 - s2)
    ans = min(ans, z)
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
w = [int, input().split()]
s1 = w[0]
s2 = w[n-1]
for i in range(1, n-2):
    if s1 < s2:
        s1 += w[i]
    else:
        s2 += w[-i-1]
print(abs(s1 - s2))

Fixed submission:
n = int(input())
w = list(map(int, input().split()))
ans = float('inf')
for i in range(n):
    s1 = sum(w[:i])
    s2 = sum(w[i:])
    z = abs(s1 - s2)
    ans = min(ans, z)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0
for i range(n):
    d = v[i] - c[i]
    if 0 < d:
        ans += d
print(int(ans))

Fixed submission:
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0
for i in range(n):
    d = v[i] - c[i]
    if 0 < d:
        ans += d
print(int(ans))

Buggy python submission (verdict: Runtime Error):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
d = 0
for i range(n):
    d = v[i] - c[i]
    if 0 < d:
        ans += d
print(int(ans))

Fixed submission:
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0
for i in range(n):
    d = v[i] - c[i]
    if 0 < d:
        ans += d
print(int(ans))

Buggy python submission (verdict: Runtime Error):
n = int(input())
v = list(map(int, input().split))
c = list(map(int, input().split))
d = 0
for i range(n):
    d = v[i] - c[i]
    if 0 < d:
        ans += d
print(int(ans))


Fixed submission:
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0
for i in range(n):
    d = v[i] - c[i]
    if 0 < d:
        ans += d
print(int(ans))
Buggy python submission (verdict: Runtime Error):
def gcd(x, y):
if y == 0:
    return x
else:
    return gcd(y, x % y)

n = int(input())
aaa = list(map(int, input().split()))
cnt_l = [0] * (n - 1)
cnt_r = [0] * (n - 1)

cnt_l[0] = aaa[0]
for i in range(1, n - 1):
cnt_l[i] = gcd(cnt_l[i - 1], aaa[i])

aaa.reverse()
cnt_r[0] = aaa[0]
for i in range(1, n - 1):
cnt_r[i] = gcd(cnt_r[i - 1], aaa[i])

cnt_l = [cnt_r[-1]] + cnt_l
cnt_r = [cnt_l[-1]] + cnt_r
cnt_r.reverse()

ans = 0
for i in range(n - 1):
tmp = gcd(cnt_l[i], cnt_r[i])
ans = max(ans, tmp)

print(ans)


Fixed submission:
from fractions import gcd
n = int(input())
aaa = list(map(int, input().split()))
p = aaa[0]
f = [p]
for a in aaa[1:-1]:
    p = gcd(p, a)
    f.append(p)
aaa.reverse()
p = aaa[0]
b = [p]
for a in aaa[1:-1]:
    p = gcd(p, a)
    b.append(p)
b.reverse()

f = [b[0]] + f
b = b + [f[-1]]

print(max(gcd(p, q) for p, q in zip(f, b)))

Buggy python submission (verdict: Runtime Error):
from fractions import gcd
n = int(input())
aaa = list(map(int, input().split()))
p = aaa[0]
f = [p]
for a in aaa[1:-1]:
    p = gcd(p, a)
    f.append(p)
aaa.reverse()
p = aaa[0]
b = [p]
for a in a[1:-1]:
    p = gcd(p, a)
    b.append(p)
f = [b[0]] + f
b = b + [f[-1]]
print(max(gcd(p, q)) for p, q in zip(f, b))

Fixed submission:
from fractions import gcd
n = int(input())
aaa = list(map(int, input().split()))
p = aaa[0]
f = [p]
for a in aaa[1:-1]:
    p = gcd(p, a)
    f.append(p)
aaa.reverse()
p = aaa[0]
b = [p]
for a in aaa[1:-1]:
    p = gcd(p, a)
    b.append(p)
b.reverse()

f = [b[0]] + f
b = b + [f[-1]]

print(max(gcd(p, q) for p, q in zip(f, b)))
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
ans = 0
for i in range(n):
    if h[i:] = max(h[i:]):
        ans += 1
print(ans)


Fixed submission:
n = int(input())
h = [int(i) for i in input().split()]
maxi = 0
ans = 0
for i in range(n):
    if maxi <= h[i]:
        ans += 1
        maxi = h[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
l = [int(input()) for _ in range(5)]
ans = 0
p = 0
for i in l:
    if i % 10 != 0:
        p = 10 - i % 10
    else:
        p = 0
    ans += i + p
    m = max(m, p)
print(ans - m)

Fixed submission:
l = [int(input()) for _ in range(5)]
ans = 0
m = 0
for i in l:
    if i % 10 != 0:
        p = 10 - i % 10
    else:
        p = 0
    ans += i + p
    m = max(m, p)
print(ans - m)

Buggy python submission (verdict: Runtime Error):
l = [int(input()) for _ in range(5)]
ans = 0
for j in range(5):
    if 0 < l[j] % 10:
        ans += (l[j] // 10 + 1) * 10
    else:
        ans += l[j]
l %= 10
ans -= min(l)
ans += 10
print(ans)


Fixed submission:
l = [int(input()) for _ in range(5)]
ans = 0
m = 0
for i in l:
    if i % 10 != 0:
        p = 10 - i % 10
    else:
        p = 0
    ans += i + p
    m = max(m, p)
print(ans - m)

Buggy python submission (verdict: Runtime Error):
l = [int(input()) for _ in range(5)]
ans = 0
for j in range(5):
    if 0 < l[j] % 10 and min(l % 10) == l[j]:
        ans += l[j]
    elif 0 < l[j] % 10:
        ans += (l[j] // 10 + 1) * 10
    else:
        ans += l[j]
print(ans)

Fixed submission:
l = [int(input()) for _ in range(5)]
ans = 0
m = 0
for i in l:
    if i % 10 != 0:
        p = 10 - i % 10
    else:
        p = 0
    ans += i + p
    m = max(m, p)
print(ans - m)

Buggy python submission (verdict: Runtime Error):
l = [int(i) for i in input()]
ans = 0
for j in l:
    if 0 < l[j] % 10:
        ans += (l[j] % 10 + 1) * 10
    else:
        ans += l[j]
print(ans)

Fixed submission:
l = [int(input()) for _ in range(5)]
ans = 0
m = 0
for i in l:
    if i % 10 != 0:
        p = 10 - i % 10
    else:
        p = 0
    ans += i + p
    m = max(m, p)
print(ans - m)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
num = min(a, b, c, d, e)
cnt = n // nu if n % num == 0 else n // num + 1
print(cnt + 4)

Fixed submission:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
num = min(a, b, c, d, e)
cnt = n // num if n % num == 0 else n // num + 1
print(cnt + 4)
Buggy python submission (verdict: Runtime Error):
s = list(input())
ctn = 0
for i in s:
    if i in ['A', 'G', 'C', 'T']:
        ctn += 1
        m = max(m, ctn)
    else:
        ctn = 0
print(ctn)

Fixed submission:
s = list(input())
ctn = 0
m = 0
for i in s:
    if i in ['A', 'C', 'G', 'T']:
        ctn += 1
        m = max(m, ctn)
    else:
        ctn = 0
print(m)
Buggy python submission (verdict: Runtime Error):
n, q = map(int, input().split())
sss = list(input())
cnt = [0] * (n + 1)
for i in range(1, n + 1):
    if sss[i - 1] == 'A' and sss[i] == 'C':
        cnt[i] += cnt[i - 1] + 1
    else:
        cnt[i] += cnt[i - 1]

for _ in range(q):
    li, ri = map(int, input().split())
    print(cnt[ri - 1] - cnt[li - 1])

Fixed submission:
n, q = map(int, input().split())
s = list(input())
lrs = [list(map(int, input().split())) for _ in range(q)]
d = [0] * n
cnt = 0
for i in range(n-1):
    if s[i:i + 2] == ['A', 'C']:
        cnt += 1
    d[i+1] = cnt
for j in range(q):
    l, r = lrs[j][0], lrs[j][1]
    print(d[r - 1] - d[l - 1])
Buggy python submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b = [int(i) for i in input().split()]
a = [[int(input()) for _ in range(m)] for _ in range(n)]
ans = 0
ctn = 0
for j in range(n):
    for k in range(m):
        ctn += b[k] * a[j][k]
    if ctn + c > 0:
        ans += 1
    ctn = 0
print(ans)


Fixed submission:
n, m, c = map(int, input().split())
b = [int(i) for i in input().split()]
a = [[int(j) for j in input().split()] for _ in range(n)]
ans = 0
for k in range(n):
    ct = c
    for l in range(m):
        ct += a[k][l] * b[l]
    if ct > 0:
        ans += 1
    ct = 0
print(ans)

Buggy python submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b = [int(i) for i in input().split()]
a = [[int(input()) for _ in range(m)] for _ in range(n)]
ans = 0
ctn = 0
for j in range(n):
    for k in range(m):
        ctn += b[n] * a[n][m]
    if ctn - c > 0:
        ans += 0
    ctn = 0
print(ans)

Fixed submission:
n, m, c = map(int, input().split())
b = [int(i) for i in input().split()]
a = [[int(j) for j in input().split()] for _ in range(n)]
ans = 0
for k in range(n):
    ct = c
    for l in range(m):
        ct += a[k][l] * b[l]
    if ct > 0:
        ans += 1
    ct = 0
print(ans)
Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
ans = []
for i in range(1, min(a, b)):
    if a % i == 0 and b % i == 0:
        ans.append(i)
print(ans[-k])

Fixed submission:
a, b, k = map(int, input().split())
ans = []
for i in range(1, 101):
    if a % i == 0 and b % i == 0:
        ans.append(i)
print(ans[-k])
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans, a = 0, 0
for i in range(n):
    x, u = input().split()
    x = float(x)
    if u == 'JPY'
        ans += x
    else:
        ans += x * 380000
print(ans)

Fixed submission:
n = int(input())
l = [input().split() for _ in range(n)]
ans = 0
for x, u in l:
    x = float(x)
    if u == 'JPY':
        ans += x
    else:
        ans += x * 380000
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(n):
    x, u = input().split()
    x = float(x)
    if u == 'JPY'
        ans += x
    else:
        ans += x * 380000
print(ans)

Fixed submission:
n = int(input())
l = [input().split() for _ in range(n)]
ans = 0
for x, u in l:
    x = float(x)
    if u == 'JPY':
        ans += x
    else:
        ans += x * 380000
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(n):
    x, u = input().split()
    x = float(x)
    if u == 'JPY'
        ans += x
    else:
        ans += x * 380000
print(ans)

Fixed submission:
n = int(input())
l = [input().split() for _ in range(n)]
ans = 0
for x, u in l:
    x = float(x)
    if u == 'JPY':
        ans += x
    else:
        ans += x * 380000
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 0
for j in l:
    x, u = input().split()
    if u == 'JPY'
        ans += int(x)
    else:
        ans += float(x) * 380000
print(ans)


Fixed submission:
n = int(input())
l = [input().split() for _ in range(n)]
ans = 0
for x, u in l:
    x = float(x)
    if u == 'JPY':
        ans += x
    else:
        ans += x * 380000
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = [input().split() for i in range(n)]
ans = 0
for j in range(n):
    if l[j][1] == 'JPY'
        ans += int(l[j][0])
    else:
        ans += int(l[j][0]) * 380000
print(ans)

Fixed submission:
n = int(input())
l = [input().split() for _ in range(n)]
ans = 0
for x, u in l:
    x = float(x)
    if u == 'JPY':
        ans += x
    else:
        ans += x * 380000
print(ans)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
cnt = [0] * m
for _ in range(n):
    k, *a = map(int, input().split())
    for A in a:
        cnt[A - 1] += 1
print(sum(c == n for c in cnt))


Fixed submission:
a, b = map(int, input().split())
if b % a == 0:
  print(a + b)
else:
  print(b - a)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
hhh = list(map(int, input().split()))
dp = [float('inf')] * n
dp[0] = 0
for i in range(1, n):
    min_tmp = float('inf')
    if i - k >= 0:
        for j in range(i - k, i):
            tmp = dp[j] + abs(hhh[i] - hhh[j])
            min_tmp = min(tmp, min_tmp)
        dp[i] = min_tmp
    else:
        for j in range(i):
            tmp = dp[j] + abs(hhh[i] - hhh[j])
            min_tmp = min(tmp, min_tmp)
        dp[i] = min_tmp
print(dp[-1])

Fixed submission:
n, k = map(int, input().split())
hhh = list(map(int, input().split()))
dp = [float('inf')] * n
dp[0] = 0
for i in range(1, n):
    min_tmp = float('inf')
    if i - k >= 0:
        for j in range(i - k, i):
            tmp = dp[j] + abs(hhh[i] - hhh[j])
            min_tmp = min(tmp, min_tmp)
        dp[i] = min_tmp
    else:
        for j in range(i):
            tmp = dp[j] + abs(hhh[i] - hhh[j])
            min_tmp = min(tmp, min_tmp)
        dp[i] = min_tmp
print(dp[-1])
Buggy python submission (verdict: Runtime Error):
print({25 : 'Christmas', 24 : 'Christmas Eve', 23 : 'Christmas Eve Eve', 22 : 'Christmas Eve Eve Eve'}[input()])


Fixed submission:
print({25 : 'Christmas', 24 : 'Christmas Eve', 23 : 'Christmas Eve Eve', 22 : 'Christmas Eve Eve Eve'}[int(input())])
Buggy python submission (verdict: Runtime Error):
n = int(input())
a, b = map(int, input().split())
if a == 1:
  print('Hellp World')
else:
  print(a + b)

Fixed submission:
n = int(input())
print('Hello World' if n == 1 else int(input()) + int(input()))
Buggy python submission (verdict: Runtime Error):
n = int(input())
xyh = [list(map(int, input().split())) for _ in range(n)]

def answer(cx, cy, xyh):
    h_list = []
    flag = True
    for x, y, h in xyh:
        if h > 0:
            tmp_h = abs(x - cx) + abs(y - cy) + h
            h_list.append(tmp_h)
        if min(h_list) != max(h_list):
            flag = False
    if flag:
        return print(cx, cy, h_list[0], sep=' ')

for cx in range(0, 101):
    for cy in range(0, 101):
        answer(cx, cy, xyh)

Fixed submission:
n = int(input())
xyh = []
x0, y0, h0 = None, None, None
for _ in range(n):
    x, y, h = map(int, input().split())
    if h > 0 and x0 is None:
        x0, y0, h0 = x, y, h
    xyh.append([x, y, h])

for cx in range(101):
    for cy in range(101):
        h = h0 + abs(x0 - cx) + abs(y0 - cy)
        done = True
        for xk, yk, hk in xyh:
            h_ = max(h - abs(xk - cx) - abs(yk - cy), 0)
            if h_ != hk:
                done = False
                break
        if done:
            print(f'{cx} {cy} {h}')
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = ''`
while n != 0:
    if n % (-2) == 0:
        ans = '0' + ans
    else:
        ans = '1' + ans
        n -= 1
    n /= -2
if ans == '':
    ans = '0'
print(ans)

Fixed submission:
n = int(input())
ans = ''
while n != 0:
    if n % (-2) == 0:
        ans = '0' + ans
    else:
        ans = '1' + ans
        n -= 1
    n /= -2
if ans == '':
    ans = '0'
print(ans)
Buggy python submission (verdict: Runtime Error):
s = list(map(str, input().split()))
ans = 0
for i in range(4):
    if s[i] == '+':
        ans += 1
    else:
        ans -= 1
print(ans)

Fixed submission:
s = input()
print(s.count('+') - s.count('-'))
Buggy python submission (verdict: Runtime Error):
n = int(input())
print('ABC' + n if n < 1000 else 'ABD' + n)

Fixed submission:
n = int(input())
print('ABC' if n < 1000 else 'ABD')
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(max(a + b, a - b, ab))

Fixed submission:
a, b = map(int, input().split())
print(max(a + b, a - b, a * b))
Buggy python submission (verdict: Runtime Error):
s = input()
print(700 + 100 * s.count())
         

Fixed submission:
s = input()
print(700 + 100 * s.count('o'))

Buggy python submission (verdict: Runtime Error):
s = list(map(str, input().split()))
ctn = 0
for i in range(3):
  if s[i] == 'o':
    ctn += 1
print(700 + 100 * ctn)
         

Fixed submission:
s = input()
print(700 + 100 * s.count('o'))
Buggy python submission (verdict: Runtime Error):
s = input()
s.sort()
print('Yes' if ''.join(s) == 'abc' else 'No')

Fixed submission:
s = list(input())
s.sort()
print('Yes' if ''.join(s) == 'abc' else 'No')

Buggy python submission (verdict: Runtime Error):
s = input()
s.sort()
print('Yes' if s == 'abc' else 'No')

Fixed submission:
s = list(input())
s.sort()
print('Yes' if ''.join(s) == 'abc' else 'No')
Buggy python submission (verdict: Runtime Error):
print('Yes' if int(input()) % 500 <= a else 'No')

Fixed submission:
n = int(input())
a = int(input())
print('Yes' if n % 500 <= a else 'No')