Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]
sum_abs, min_abs, cnt_minus = 0, 10**9, 0
for ai in a:
    if ai < 0:
        cnt_minus += 1
    abs_ai = abs(ai)
    sum_abs += abs_ai
    if abs_ai < min_abs:
        min_abs = abs_ai
if cnt_minus % 2 == 0 or a in 0:
    print(sum_abs)
else:
    print(sum_abs - 2*min_abs)

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]
sum_abs, min_abs, cnt_minus = 0, 10**9, 0
for ai in a:
    if ai < 0:
        cnt_minus += 1
    abs_ai = abs(ai)
    sum_abs += abs_ai
    if abs_ai < min_abs:
        min_abs = abs_ai
if cnt_minus % 2 == 0 or 0 in a:
    print(sum_abs)
else:
    print(sum_abs - 2*min_abs)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]
print(-(-n // min(a)) + 4)

Fixed submission:
n = int(input())
a = [int(input()) for i in range(5)]
print(-(-n // min(a)) + 4)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
all = {int(i) for i in range(1, i + 1)}
for _ in range(n):
    k, *i_th = map(int, input().split())
    all &= set(list(i_th))
print(len(all))

Fixed submission:
n, m = map(int, input().split())
all = {int(i) for i in range(1, m + 1)}
for _ in range(n):
    k, *i_th = map(int, input().split())
    all &= set(i_th)
print(len(all))
Buggy python submission (verdict: Runtime Error):
from math import gcd
n = int(input())
a = [int(i) for i in input().split()]
ans = a[0]
for i in range(n - 1):
    ans = gcd(ans, a[i + 1])
print(ans)

Fixed submission:
from fractions import gcd
n = int(input())
a = [int(i) for i in input().split()]
ans = a[0]
for i in range(n - 1):
    ans = gcd(ans, a[i + 1])
print(ans)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
x = sorted([int(i) for i in input().split()])
diff_x = [x[i + 1] - x[i] for i in range(m - 1)]
max_diff = []
if n >= m:
    print(0)
else:
    for _ in range(n - 1):
        max_diff_i = diff_x.index(max(diff_x))
        max_diff.append(max_diff_i)
        diff_x[max_diff_i] = -10**6
    max_diff.sort()

    move = x[max_diff[0]] - x[0]
    for i in range(n - 2):
        move += x[max_diff[i + 1]] - x[max_diff[i] + 1]
    move += x[m - 1] - x[max_diff[n - 2] + 1]
    print(move)

Fixed submission:
n, m = map(int, input().split())
x = sorted([int(i) for i in input().split()])
diff_x = [x[i + 1] - x[i] for i in range(m - 1)]
diff_x.sort(reverse=True)
if n >= m:
    print(0)
else:
    print((x[m - 1] - x[0]) - sum(diff_x[0:n - 1]))

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
x = sorted([int(i) for i in input().split()])
diff_x = [x[i + 1] - x[i] for i in range(m - 1)]
max_diff = []
if m == 1:
    print(0)
else:
    for _ in range(n - 1):
        max_diff_i = diff_x.index(max(diff_x))
        max_diff.append(max_diff_i)
        diff_x[max_diff_i] = -10**6
    max_diff.sort()

    move = x[max_diff[0]] - x[0]
    for i in range(n - 2):
        move += x[max_diff[i + 1]] - x[max_diff[i] + 1]
    move += x[m - 1] - x[max_diff[n - 2] + 1]
    print(move)

Fixed submission:
n, m = map(int, input().split())
x = sorted([int(i) for i in input().split()])
diff_x = [x[i + 1] - x[i] for i in range(m - 1)]
diff_x.sort(reverse=True)
if n >= m:
    print(0)
else:
    print((x[m - 1] - x[0]) - sum(diff_x[0:n - 1]))

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
x = sorted([int(i) for i in input().split()])
diff_x = [x[i + 1] - x[i] for i in range(m - 1)]
max_diff = []
for _ in range(n - 1):
    max_diff_i = diff_x.index(max(diff_x))
    max_diff.append(max_diff_i)
    diff_x[max_diff_i] = -1
max_diff.sort()

move = x[max_diff[0]] - x[0]
for i in range(n - 2):
    move += x[max_diff[i + 1]] - x[max_diff[i] + 1]
move += x[m - 1] - x[max_diff[n - 2] + 1]
print(move)

Fixed submission:
n, m = map(int, input().split())
x = sorted([int(i) for i in input().split()])
diff_x = [x[i + 1] - x[i] for i in range(m - 1)]
diff_x.sort(reverse=True)
if n >= m:
    print(0)
else:
    print((x[m - 1] - x[0]) - sum(diff_x[0:n - 1]))
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = [int(i) for i in input().split()]
dp = [0]
for i in range(1, n):
    to = min(i, k) + 1
    dp += [min([dp[-j] + abs(h[i] - h[i - j]) for j in range(1, to)])]
print(dp[-1])

Fixed submission:
n, k = map(int, input().split())
h = [int(i) for i in input().split()]
dp = [0]
for i in range(1, n):
    to = min(i, k) + 1
    dp += [min([dp[-j] + abs(h[i] - h[i - j]) for j in range(1, to)])]
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = [int(i) for i in input().split()]
dp = [0]
for i in range(1, n):
    dp += [min([dp[-j] + abs(h[i] - h[i - j]) for j in range(1, min(i, k) + 1)])]
print(dp[-1])

Fixed submission:
n, k = map(int, input().split())
h = [int(i) for i in input().split()]
dp = [0]
for i in range(1, n):
    to = min(i, k) + 1
    dp += [min([dp[-j] + abs(h[i] - h[i - j]) for j in range(1, to)])]
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = [int(i) for i in input().split()]
dp = [0]
for i in range(1, n):
    dp += [min([dp[i - j] + abs(h[i] - h[i - j]) for j in range(1, min(i, k) + 1)])]
print(dp[-1])

Fixed submission:
n, k = map(int, input().split())
h = [int(i) for i in input().split()]
dp = [0]
for i in range(1, n):
    to = min(i, k) + 1
    dp += [min([dp[-j] + abs(h[i] - h[i - j]) for j in range(1, to)])]
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
INF = float('inf')
n, k = map(int, input().split())
h = [int(i) for i in input().split()] + [0] * k
dp = [0] + [INF] * (n - 1 + k)
for i in range(n):
    for j in range(1, k + 1):
        dp[i + j] = min(dp[i + j], dp[i] + abs(h[i + j] - h[i]))
print(dp[n - 1])

Fixed submission:
n, k = map(int, input().split())
h = [int(i) for i in input().split()]
dp = [0]
for i in range(1, n):
    to = min(i, k) + 1
    dp += [min([dp[-j] + abs(h[i] - h[i - j]) for j in range(1, to)])]
print(dp[-1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
abc = [[int(j) for j in input().split()] for i in range(n)]
dp = [[0] * 3]
for day in range(N):
    dp += [[max([dp[-1][p] + abc[day][n] for p in range(3) if p != n]) for n in range(3)]]
print(max(dp[-1]))

Fixed submission:
N = int(input())
abc = [[int(j) for j in input().split()] for i in range(N)]
dp = [[0] * 3]
for day in range(N):
    dp += [[max([dp[-1][p] + abc[day][n] for p in range(3) if p != n]) for n in range(3)]]
print(max(dp[-1]))

Buggy python submission (verdict: Runtime Error):
N = int(input())
abc = [[int(j) for j in input().split()] for i in range(n)]
dp = [[0] * 3]
for day in range(N):
    dp += [[max([dp[-1][p] + abc[day][n] for p in range(3) if p != n]) for n in range(3)]]
print(max(dp[-1]))

Fixed submission:
N = int(input())
abc = [[int(j) for j in input().split()] for i in range(N)]
dp = [[0] * 3]
for day in range(N):
    dp += [[max([dp[-1][p] + abc[day][n] for p in range(3) if p != n]) for n in range(3)]]
print(max(dp[-1]))

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

Fixed submission:
N = int(input())
abc = [[int(j) for j in input().split()] for i in range(N)]
dp = [[0] * 3]
for day in range(N):
    dp += [[max([dp[-1][p] + abc[day][n] for p in range(3) if p != n]) for n in range(3)]]
print(max(dp[-1]))
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print(max(a, b, c)*9 + sum(a, b, c))

Fixed submission:
a, b, c = map(int, input().split())
print(max(a, b, c)*9 + sum([a, b, c]))
Buggy python submission (verdict: Runtime Error):
from fractions import gcd
n, X = map(int, input().split())
x = sorted([int(i) for i in input().split()] + [X])
diff_x = [x[i + 1] - x[i] for i in range(n)]
if len(diff_x) == 1:
    print(diff_x[0])
else:
    gcd = gcd(diff_x[0], diff_x[1])
    for i in range(2, n):
        gcd = gcd(gcd, diff_x[i])
    print(gcd)

Fixed submission:
from fractions import gcd
n, X = map(int, input().split())
x = sorted([int(i) for i in input().split()] + [X])
diff_x = [x[i + 1] - x[i] for i in range(n)]
if len(diff_x) == 1:
    print(diff_x[0])
else:
    d = gcd(diff_x[0], diff_x[1])
    for i in range(2, n):
        d = gcd(d, diff_x[i])
    print(d)

Buggy python submission (verdict: Runtime Error):
from fractions import gcd
n, X = map(int, input().split())
x = sorted([int(i) for i in input().split()] + [X])
diff_x = [x[i + 1] - x[i] for i in range(n)]
if len(diff_x) == 1:
    print(diff_x[0])
else:
    gcd = gcd(diff_x[0], diff_x[1])
    for i in range(2, n - 1):
        gcd = gcd(gcd, diff_x[i])
    print(gcd)

Fixed submission:
from fractions import gcd
n, X = map(int, input().split())
x = sorted([int(i) for i in input().split()] + [X])
diff_x = [x[i + 1] - x[i] for i in range(n)]
if len(diff_x) == 1:
    print(diff_x[0])
else:
    d = gcd(diff_x[0], diff_x[1])
    for i in range(2, n):
        d = gcd(d, diff_x[i])
    print(d)
Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
def lcm(a):
    len_a = len(a)
    ret = a[0]
    for i in range(1, len_a):
        ret = (ret * a[i]) // gcd(ret, a[i])
    return ret
n = int(input())
a = [int(i) for i in input().split()]

def f(m):
    sum = 0
    for i in range(n):
        sum += m % a[i]
    return sum

print(max(f(i) for i in range(lcm(a))))

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]
print(sum(a) - n)
Buggy python submission (verdict: Runtime Error):
d, n = map(int, input().split())
print([i*100**d for i in range(1, 101) if i != 100][n - 1])

Fixed submission:
d, n = map(int, input().split())
print([i*100**d for i in range(1, 102) if i != 100][n - 1])

Buggy python submission (verdict: Runtime Error):
d, n = map(int, input().split())
print([i*100**d for i in range(101) if i != 100][n])

Fixed submission:
d, n = map(int, input().split())
print([i*100**d for i in range(1, 102) if i != 100][n - 1])
Buggy python submission (verdict: Runtime Error):
x = int(input())
print(max([i**j for i in range(1, int(x**0.5) + 1) for j in range(2, min(10, x + 1)) if i**j <= x]))

Fixed submission:
x = int(input())
max_pow = []
for i in range(2, int(x**0.5) + 1):
    j = 2
    while i**j <= x:
        j += 1
    max_pow.append(i**(j - 1))
print(1 if x == 1 else max(max_pow))
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
diff_max = 3*max(a, b, c) - sum(a, b, c)
if diff_max % 2:
    print((diff_max + 3) // 2)
else:
    print(diff_max // 2)

Fixed submission:
a, b, c = map(int, input().split())
diff_max = 3*max(a, b, c) - sum([a, b, c])
if diff_max % 2:
    print((diff_max + 3) // 2)
else:
    print(diff_max // 2)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [0] + [int(i) for i in input().split()] + [0]
d1a = [abs(a[i + 1] - a[i]) for i in range(n + 1)]
d2a = [abs(a[i + 1] - a[i - 1]) for i in range(1, n + 1)]
sum_a = sum(a)
for i in range(1, n + 1):
    print(sum_a + d2a[i] - (d1a[i - 1] + d1a[i]))

Fixed submission:
n = int(input())
a = [0] + [int(i) for i in input().split()] + [0]
d1a = [abs(a[i + 1] - a[i]) for i in range(n + 1)]
d2a = [abs(a[i + 1] - a[i - 1]) for i in range(1, n + 1)]
sum_a = sum(d1a)
for i in range(1, n + 1):
    print(sum_a + d2a[i - 1] - (d1a[i - 1] + d1a[i]))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [0] + [int(i) for i in input().split()] + [0]
d1a = [abs(a[i + 1] - a[i]) for i in range(n + 1)]
d2a = [abs(a[i + 1] - a[i - 1]) for i in range(1, n + 1)]
sum_a = sum(a)
for i in range(1, n + 1):
    print(sum(a) + d2a[i] - (d1a[i - 1] + d1a[i]))

Fixed submission:
n = int(input())
a = [0] + [int(i) for i in input().split()] + [0]
d1a = [abs(a[i + 1] - a[i]) for i in range(n + 1)]
d2a = [abs(a[i + 1] - a[i - 1]) for i in range(1, n + 1)]
sum_a = sum(d1a)
for i in range(1, n + 1):
    print(sum_a + d2a[i - 1] - (d1a[i - 1] + d1a[i]))
Buggy python submission (verdict: Runtime Error):
c = [input() for i in range(3)]
print(c[i][i] for i in range(3), sep='')

Fixed submission:
c = [input() for i in range(3)]
for i in range(3):
    print(c[i][i], end='', sep='')
Buggy python submission (verdict: Runtime Error):
from collections import deque
h, w = map(int, input().split())
cnt_b = 0
s = []
for i in range(h):
    si = input()
    cnt_b += si.count('#')
    s.append(si)

def bfs(i0, j0):
    INF = 1000
    search = deque([(i0, j0)])
    d = [[INF] * w for i in range(h)]
    d[i0][j0] = 1
    while search:
        i, j = search.popleft()
        if (i, j) == (h - 1, w - 1):
            break
        for di, dj in ((1, 0), (0, 1), (-1, 0), (0, -1)):
            ni, nj = i + di, j + dj
            if 0 <= ni < h and 0 <= nj < w and s[ni][nj] == '.' and d[ni][nj] == INF:
                search.append((ni, nj))
                d[ni][nj] = d[i][j] + 1
    return d[i][j] if d[i][j] != INF else 0 
solvable = bds(0, 0)
print(h*w - cnt_b - solvable if solvable else -1)

Fixed submission:
from collections import deque
h, w = map(int, input().split())
cnt_b = 0
s = []
for i in range(h):
    si = input()
    cnt_b += si.count('#')
    s.append(si)

def bfs(i0, j0):
    INF = 1000
    search = deque([(i0, j0)])
    d = [[INF] * w for i in range(h)]
    d[i0][j0] = 1
    while search:
        i, j = search.popleft()
        if (i, j) == (h - 1, w - 1):
            break
        for di, dj in ((1, 0), (0, 1), (-1, 0), (0, -1)):
            ni, nj = i + di, j + dj
            if 0 <= ni < h and 0 <= nj < w and s[ni][nj] == '.' and d[ni][nj] == INF:
                search.append((ni, nj))
                d[ni][nj] = d[i][j] + 1
    return d[i][j] if d[h - 1][w - 1] != INF else 0 
solvable = bfs(0, 0)
print(h*w - cnt_b - solvable if solvable else -1)

Buggy python submission (verdict: Runtime Error):
from collections import deque
h, w = map(int, input().split())
cnt_b = 0
s = []
for i in range(h):
    si = input()
    cnt_b += si.count('#')
    s.append(si)

def bfs(i0, j0):
    INF = 1000
    search = deque([(i0, j0)])
    d = [[INF] * w for i in range(h)]
    d[i0][j0] = 1
    while search:
        i, j = search.popleft()
        if (i, j) == (h - 1, w - 1):
        for di, dj in ((1, 0), (0, 1), (-1, 0), (0, -1)):
            ni, nj = i + di, j + dj
            if 0 <= ni < h and 0 <= nj < w and s[ni][nj] == '.' and d[ni][nj] == INF:
                search.append((ni, nj))
                d[ni][nj] = d[i][j] + 1
    return d[i][j]
print(h*w - cnt_b - bfs(0, 0))

Fixed submission:
from collections import deque
h, w = map(int, input().split())
cnt_b = 0
s = []
for i in range(h):
    si = input()
    cnt_b += si.count('#')
    s.append(si)

def bfs(i0, j0):
    INF = 1000
    search = deque([(i0, j0)])
    d = [[INF] * w for i in range(h)]
    d[i0][j0] = 1
    while search:
        i, j = search.popleft()
        if (i, j) == (h - 1, w - 1):
            break
        for di, dj in ((1, 0), (0, 1), (-1, 0), (0, -1)):
            ni, nj = i + di, j + dj
            if 0 <= ni < h and 0 <= nj < w and s[ni][nj] == '.' and d[ni][nj] == INF:
                search.append((ni, nj))
                d[ni][nj] = d[i][j] + 1
    return d[i][j] if d[h - 1][w - 1] != INF else 0 
solvable = bfs(0, 0)
print(h*w - cnt_b - solvable if solvable else -1)
Buggy python submission (verdict: Runtime Error):
a, b = input().split()
is_square = False
for i in range(1, 101):
  if i**2 == int(a * b):
    is_square = True
    break
print('Yes' if is_square else 'No')

Fixed submission:
a, b = input().split()
is_square = False
for i in range(1, 317):
  if i**2 == int(a + b):
    is_square = True
    break
print('Yes' if is_square else 'No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
set_d = set()
for i in range(n):
  d = int(input())
  set_d |= d
print(len(set_d))
  

Fixed submission:
n = int(input())
set_d = set()
for i in range(n):
  d = int(input())
  set_d.add(d)
print(len(set_d))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input())
s = input()
try:
  ac, bc = int(s[:a]), int(s[a + 1:])
  flag = True
except ValueError:
  flag = False
print('Yes' if flag else 'No')

Fixed submission:
a, b = map(int, input().split())
s = input()
try:
  ac, bc = int(s[:a]), int(s[a + 1:])
  flag = True
except ValueError:
  flag = False
print('Yes' if flag and s[a] == '-' else 'No')
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
s = 0
for i in range(1, n + 1):
  t = sum(list(str(i)))
  if a <= sum(list(str(i))) <= b:
    s += t
print(s)

Fixed submission:
n, a, b = map(int, input().split())
s = 0
for i in range(1, n + 1):
  t = sum([int(j) for j in str(i)])
  if a <= t <= b:
    s += i
print(s)
Buggy python submission (verdict: Runtime Error):
n = input()
print('Yes' if len(set(list(n[:3]))) == 1 or len(set(list(n[1:4]))) == 1 'No')

Fixed submission:
n = input()
print('Yes' if len(set(n[:3])) == 1 or len(set(n[1:4])) == 1 else 'No')

Buggy python submission (verdict: Runtime Error):
n = input()
print('Yes' if len(set(n[:3])) == 1 or len(set(n[1:4])) == 1 'No')

Fixed submission:
n = input()
print('Yes' if len(set(n[:3])) == 1 or len(set(n[1:4])) == 1 else 'No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
to = [[] for _ in range(n + 1)]
for i in range(n - 1):
    a, b, c = map(int, input().split())
    to[a].append((b, c))
    to[b].append((a, c))

q, k = map(int, input().split())
dist_k = [0] + [-1] * n
dist_k[k] = 0

def dfs(v):
    for u, du in to[v]:
        if dist_k[u] != -1:
            continue
        dist_k[u] = dist_k[v] + du
        dfs(u)
dfs(k)
dist_xky = [0] * q
for i in range(q):
    x, y = map(int, input().split())
    dist_xky[i] = dist_k[x] + dist_k[y]
print(*dist_xky, sep='\n')

Fixed submission:
import sys
sys.setrecursionlimit(10**9)
n = int(input())
to = [[] for _ in range(n + 1)]
for i in range(n - 1):
    a, b, c = map(int, input().split())
    to[a].append((b, c))
    to[b].append((a, c))

q, k = map(int, input().split())
dist_k = [0] + [-1] * n
dist_k[k] = 0

def dfs(v):
    for u, du in to[v]:
        if dist_k[u] != -1:
            continue
        dist_k[u] = dist_k[v] + du
        dfs(u)
dfs(k)
dist_xky = [0] * q
for i in range(q):
    x, y = map(int, input().split())
    dist_xky[i] = dist_k[x] + dist_k[y]
print(*dist_xky, sep='\n')
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input())
print((n - 1) * (m - 1))


Fixed submission:
n, m = map(int, input().split())
print((n - 1) * (m - 1))

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input())
print((n - 1) * (m - 1))


Fixed submission:
n, m = map(int, input().split())
print((n - 1) * (m - 1))

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input())
print((n - 1) * (m - 1))


Fixed submission:
n, m = map(int, input().split())
print((n - 1) * (m - 1))

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input())
print((n - 1) * (m - 1))


Fixed submission:
n, m = map(int, input().split())
print((n - 1) * (m - 1))

Buggy python submission (verdict: Runtime Error):
n, ma = map(int, input())
print((n - 1) * (m - 1))

Fixed submission:
n, m = map(int, input().split())
print((n - 1) * (m - 1))
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())

x = abs(a - b)
y = abs(b - c)
z = abs(a - c)

if x <= d and y <= d:
    print("Yes")
elif x > d and z <= d:
    print("Yes")
else:
    print("No")

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

x = abs(a - b)
y = abs(b - c)
z = abs(a - c)

if x <= d and y <= d:
    print("Yes")
elif z <= d:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
# 正の整数aとb

# aとbの積が偶数か奇数か判別する
a = int( input() )
b = int( input() )

# 積が奇数なら'Odd'、偶数なら'Even'と出力する
if int(a * b / 2) == int(a * b / 2 + 0.5):
    print('even')
else:
    print('Odd')

Fixed submission:
# 正の整数aとb
a, b = map(int, input().split())
# aとbの積が偶数か奇数か判別する

# 積が奇数なら'Odd'、偶数なら'Even'と出力する
if int(a * b / 2) < int(a * b / 2 + 0.5):
    print('Odd')
else:
    print('Even')

Buggy python submission (verdict: Runtime Error):
# 正の整数aとb

# aとbの積が偶数か奇数か判別する
a = int( input() )
b = int( input() )

# 積が奇数なら'Odd'、偶数なら'Even'と出力する
if int(a * b / 2) == int(a * b / 2 - 0.5):
    print('Odd')
else:
    print('even')

Fixed submission:
# 正の整数aとb
a, b = map(int, input().split())
# aとbの積が偶数か奇数か判別する

# 積が奇数なら'Odd'、偶数なら'Even'と出力する
if int(a * b / 2) < int(a * b / 2 + 0.5):
    print('Odd')
else:
    print('Even')
Buggy python submission (verdict: Runtime Error):
candy = N * N /2 + N /2

print(candy)

Fixed submission:
N = int( input() )

candy = int( N * ( N + 1 ) / 2 )

print(candy)

Buggy python submission (verdict: Runtime Error):
c = N * (N + 1 )/2

print(c)

Fixed submission:
N = int( input() )

candy = int( N * ( N + 1 ) / 2 )

print(candy)

Buggy python submission (verdict: Runtime Error):
candy = N * (N + 1 )/2

print(candy)

Fixed submission:
N = int( input() )

candy = int( N * ( N + 1 ) / 2 )

print(candy)
Buggy python submission (verdict: Time Limit Exceeded):
from sys import setrecursionlimit
from collections import Counter
from collections import defaultdict
from collections import deque
from heapq import heapify
from heapq import heappop
from heapq import heappush
from time import time
import re
setrecursionlimit(10**9)
mod=10**9+7
inf=10**18

n=int(input())
a=[int(x) for x in input().split()]
ans=0
for i in range(n):
    ans+=a[i]*sum(a[i+1:])
    ans%=mod
     
print(ans)

Fixed submission:
from sys import setrecursionlimit
from collections import Counter
from collections import defaultdict
from collections import deque
from heapq import heapify
from heapq import heappop
from heapq import heappush
from time import time
import re
setrecursionlimit(10**9)
mod=10**9+7
inf=10**18

n=int(input())
a=[int(x) for x in input().split()]
cum_a=[]
for i in range(n):
    if i==0:cum_a.append(a[i])
    else:cum_a.append(cum_a[-1]+a[i])
ans=0
for i in range(n-1):
    ans+=a[i]*(cum_a[n-1]-cum_a[i])
    ans%=mod
     
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from sys import setrecursionlimit
from collections import Counter
from collections import defaultdict
from collections import deque
from heapq import heapify
from heapq import heappop
from heapq import heappush
from time import time
import re
setrecursionlimit(10**9)
mod=10**9+7
inf=10**18

n=int(input())
a=[int(x) for x in input().split()]
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:
from sys import setrecursionlimit
from collections import Counter
from collections import defaultdict
from collections import deque
from heapq import heapify
from heapq import heappop
from heapq import heappush
from time import time
import re
setrecursionlimit(10**9)
mod=10**9+7
inf=10**18

n=int(input())
a=[int(x) for x in input().split()]
cum_a=[]
for i in range(n):
    if i==0:cum_a.append(a[i])
    else:cum_a.append(cum_a[-1]+a[i])
ans=0
for i in range(n-1):
    ans+=a[i]*(cum_a[n-1]-cum_a[i])
    ans%=mod
     
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[int(x) for x in input().split()]
a.sort()
max=a[-1]
dp=[False for _ in range(max+1)]

Fixed submission:
x=[int(x) for x in input().split()]
print(x.index(0)+1)