Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
#CODE FESTIVAL 2016 Final-C
"""
グラフが連結であるかどうかを判定せよ？
距離が2以下になっているか判定せよかと思ったが、つながってればいいっぽい？
dfsで全部回れば良い
"""
import sys
from collections import deque
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
n,m = map(int,readline().split())
g = [[] for i in range(m)] #その言語を誰が使えるか
h = [] #誰がどの言語を使えるか
for i in range(n):
    lst1 = list(map(int,readline().split()))
    lst1 = lst1[1:]
    for j in lst1:
        g[j-1].append(i)
    h.append(lst1)


check = [0]*n
root = 0
check[root] = 1
deq = deque([root])
while deq:
    fr = deq.pop()
    for i in h[fr]:
        for j in g[i-1]:
            if check[j]:
                continue
            deq.append(j)
            check[j] = 1


if all(i==1 for i in check):
    print("YES")
else:
    print("NO")

Fixed submission:
#CODE FESTIVAL 2016 Final-C
"""
グラフが連結であるかどうかを判定せよ？
距離が2以下になっているか判定せよかと思ったが、つながってればいいっぽい？
dfsで全部回れば良い
"""
import sys
from collections import deque
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
n,m = map(int,readline().split())
g = [[] for i in range(m)] #その言語を誰が使えるか
h = [] #誰がどの言語を使えるか
for i in range(n):
    lst1 = list(map(int,readline().split()))
    lst1 = lst1[1:]
    for j in lst1:
        g[j-1].append(i)
    h.append(lst1)


check = [0]*n
language = [0]*m
root = 0
check[root] = 1
deq = deque([root])
while deq:
    fr = deq.pop()
    for i in h[fr]:
        if language[i-1]:
            continue
        language[i-1] = 1
        for j in g[i-1]:
            if check[j]:
                continue
            deq.append(j)
            check[j] = 1


if all(i==1 for i in check):
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
n,a = map(int,readline().split())
lst1 = list(map(int,readline().split()))

import numpy as np

dp = np.zeros((n+1,3000),dtype=np.int64) # 枚数、目標数ごとに場合の数
dp[0,0] = 1

for x in lst1:
  dp[1:,x:] += dp[:-1,:-x].copy()
  
ans = 0
for i in range(1,n+1):
  ans += dp[i,i*lst1]
  
print(ans)


Fixed submission:
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
n,a = map(int,readline().split())
lst1 = list(map(int,readline().split()))

import numpy as np

dp = np.zeros((n+1,3000),dtype=np.int64) # 枚数、目標数ごとに場合の数
dp[0,0] = 1

for x in lst1:
  dp[1:,x:] += dp[:-1,:-x].copy()
  
ans = 0
for i in range(1,n+1):
  ans += dp[i,i*a]
  
print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
n,a = map(int,readline().split())
lst1 = list(map(int,readline().split()))

import numpy as np

dp = np.zeros((n+1,3000),dtype=np.int64) # 枚数、目標数ごとに場合の数
dp[0,0] = 1

for x in lst1:
  dp[1:,x:] += dp[:-1,:-x].copy()
  
ans = 0
for i in range(1,n+1):
  ans += dp[i,i*lst1]
  
print(ans)


Fixed submission:
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
n,a = map(int,readline().split())
lst1 = list(map(int,readline().split()))

import numpy as np

dp = np.zeros((n+1,3000),dtype=np.int64) # 枚数、目標数ごとに場合の数
dp[0,0] = 1

for x in lst1:
  dp[1:,x:] += dp[:-1,:-x].copy()
  
ans = 0
for i in range(1,n+1):
  ans += dp[i,i*a]
  
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import itertools
readline = sys.stdin.buffer.readline

n,a = map(int,readline().split())
lst1 = list(map(int,readline().split()))

dig = n #桁数
bit_mask = list(itertools.product([0,1],repeat=dig))
ans = 0
for i in bit_mask:
    res = 0
    num = 0
    for j,k in enumerate(i):
        if k == 1:
            res += lst1[j]
            num += 1
    try:
        if res/num == a:
            ans += 1
    except:
        pass

print(ans)

Fixed submission:
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
n,a = map(int,readline().split())
lst1 = list(map(int,readline().split()))

import numpy as np

dp = np.zeros((n+1,3000),dtype=np.int64) # 枚数、目標数ごとに場合の数
dp[0,0] = 1

for x in lst1:
  dp[1:,x:] += dp[:-1,:-x].copy()
  
ans = 0
for i in range(1,n+1):
  ans += dp[i,i*a]
  
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
count = 0
for a in range(1,N+1):
  for b in range(a,N/a+1):
    count += 2
print(count)

Fixed submission:
N = int(input())
count = 0
for a in range(1,N+1):
  for b in range(a,N//a+1):
    if a * b < N:
      if a == b:
        count += 1
      else:
        count += 2
print(count)

Buggy python submission (verdict: Runtime Error):
N = int(input())
count = 0
for a in range(1,N+1):
  for b in range(a,N/a+1):
    count += 1
print(count)

Fixed submission:
N = int(input())
count = 0
for a in range(1,N+1):
  for b in range(a,N//a+1):
    if a * b < N:
      if a == b:
        count += 1
      else:
        count += 2
print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input())
import math
print(int(math.ceil(N / 1000) * 1000 - N)


Fixed submission:
N = int(input())
import math
print(int(math.ceil(N / 1000) * 1000 - N))
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = [int(input()) for n in range(N)]
assert len(S) == N
counts = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}

for s in S:
  counts[s] += 1

for key in ['AC', 'WA', 'TLE', 'RE']:
	print('{} x {}'.format(key, counts[key])

Fixed submission:
N = int(input())
S = [input() for n in range(N)]
assert len(S) == N
counts = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}

for s in S:
  counts[s] += 1

for key in ['AC', 'WA', 'TLE', 'RE']:
	print('{} x {}'.format(key, counts[key]))
Buggy python submission (verdict: Runtime Error):
print(list(map(int,input().split()).index(0) + 1)


Fixed submission:
print(list(map(int,input().split())).index(0) + 1)

Buggy python submission (verdict: Runtime Error):
print(list(map(int,input().split()).index(0))


Fixed submission:
print(list(map(int,input().split())).index(0) + 1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = reversed(sorted(map(int, input().split())))
assert len(A) == N
mul = 1
for a in A:
  mul *= a
  if mul >= 10 ** 18:
    print(-1)
    break
else:
  print(mul)

Fixed submission:
N = int(input())
#A = list(reversed(sorted(list(map(int, input().split())))))
A = sorted(list(map(int, input().split())))
assert len(A) == N
mul = 1
for a in A:
  mul *= a
#  print(a, mul)
  if a == 0:
    print(0)
    break
  if mul > (10 ** 18):
    print(-1)
    break
else:
  print(mul)
Buggy python submission (verdict: Runtime Error):
A, B = map(float, input().split())
import math

text = str(math.floor(A * B))
index = text.index('.')
if index >= 0:
  print(text[:index])
else:
  print(text)

Fixed submission:
A, B = input().split()
A = int(A)
B = int(''.join([b for b in B if b != '.']))

print(A * B // 100)
Buggy python submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())
# 1:A枚, 0:B枚, -1:C枚, K枚を選ぶ
A = max(A, K)
B = max(K - A, B)
C = max(K - A - B, C)
assert A + B + C >= K
print(A - C)A, B, C, K = map(int, input().split())
# 1:A枚, 0:B枚, -1:C枚, K枚を選ぶ
A = min(A, K)
B = min(K - A, B)
C = min(K - A - B, C)
assert A + B + C >= K
#print(A, B, C)
print(A - C)

Fixed submission:
A, B, C, K = map(int, input().split())
# 1:A枚, 0:B枚, -1:C枚, K枚を選ぶ
A = min(A, K)
B = min(K - A, B)
C = min(K - A - B, C)
assert A + B + C >= K
#print(A, B, C)
print(A - C)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
sunukes = [0 for k in range(N)]
for k in range(K):
  d = int(input())
  A = list(map(int, input().split()))
  for a in A:
    sunukes[a] += 1
  assert len(A) == d
print(len([k for k in sunukes if k == 0]))

Fixed submission:
N, K = map(int, input().split())
sunukes = [0 for k in range(N)]
for k in range(K):
  d = int(input())
  A = list(map(int, input().split()))
  for a in A:
    sunukes[a-1] += 1
  assert len(A) == d
print(len([k for k in sunukes if k == 0]))
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
H = list(map(int, input().split())) #展望台iの標高
assert len(H) == N
paths = [[] for i in range(N)]
for m in range(M):
  a, b = map(int, input().split())
  paths[a].append(b)
  paths[b].append(a) # 展望台AからBへの道、その逆
assert len(A) == M

count = 0
for a in A:
  for b in paths[b]:
    if H[b] >= H[a]:
      break
  else:
    count += 1
print(count)

Fixed submission:
N, M = map(int, input().split())
H = list(map(int, input().split())) #展望台iの標高
assert len(H) == N
paths = [[] for i in range(N)]
for m in range(M):
  a, b = map(int, input().split())
  a -= 1
  b -= 1
  paths[a].append(b)
  paths[b].append(a) # 展望台AからBへの道、その逆

count = 0
for a in range(N):
  for b in paths[a]:
    if H[b] >= H[a]:
      break
  else:
    count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
H = list(map(int, input().split())) #展望台iの標高
assert len(H) == N
paths = [[] for i in range(N)]
for m in range(M)
  a, b = map(int, input().split())
  paths[a].append(b)
  paths[b].append(a) # 展望台AからBへの道、その逆
assert len(A) == M

def search(a, marks): #返り値: aから行ける展望台の高さの最大値
  peaks = []
  marks.append(a)
  for b in paths[a]:
    if b not in marks:
      peaks.append(search)
  marks.remove(a)
  if len(peaks):
    return max(H[a], max(peaks))
  return H[a]

count = 0
for a in A:
  if a == search(a, []):
    count += 1
print(count)

Fixed submission:
N, M = map(int, input().split())
H = list(map(int, input().split())) #展望台iの標高
assert len(H) == N
paths = [[] for i in range(N)]
for m in range(M):
  a, b = map(int, input().split())
  a -= 1
  b -= 1
  paths[a].append(b)
  paths[b].append(a) # 展望台AからBへの道、その逆

count = 0
for a in range(N):
  for b in paths[a]:
    if H[b] >= H[a]:
      break
  else:
    count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
assert len(A) == N - 1
count = [0 for i in range(len(A))]
for a in A:
  count[a] += 1
for n in range(N):
  print(count[n])

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
assert len(A) == N - 1
count = [0 for i in range(N)]
for a in A:
  count[a-1] += 1
for n in range(N):
  print(count[n])
Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())
total = 0

def gcd2(a,b): #互除法
  while True:
    mod = a % b
    if mod == 0:
      return b
    a = b
    b = mod

memo = {}
def gcd(a,b,c):
  a,b,c = sorted([a,b,c])
  if (a,b,c) not in memo:
    val = gcd2(gcd2(a,b), c)
    memo[(a,b,c)] = val
    return val
  return memo[(a,b,c)]

for a in range(1, K+1):
  for b in range(1, K+1):
    for c in range(1, K+1):
      g = gcd(a, b, c)
#      print(a,b,c, g)
      total += g

print(total)

Fixed submission:
K = int(input())
total = 0

def gcd2(a,b): #互除法
  while True:
    mod = a % b
    if mod == 0:
      return b
    a = b
    b = mod

memo = {}
def gcd(a,b,c):
  return gcd2(gcd2(a,b),c)
#  a,b,c = sorted([a,b,c])
#  if (a,b,c) not in memo:
#    val = gcd2(gcd2(a,b), c)
#    memo[(a,b,c)] = val
#    return val
#  return memo[(a,b,c)]

for a in range(1, K+1):
  for b in range(1, K+1):
    for c in range(1, K+1):
      g = gcd(a, b, c)
#      print(a,b,c, g)
      total += g

print(total)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
assert len(S) == N
count = 0
for i in range(0, len(S)-2):
  for j in range(i+1, len(S)-1):
    if S[i] == S[j]:
      continue
    SiSj = S[i] + S[j]
    if 'R' not in SiSj:
      Sk = 'R'
    elif 'G' not in SiSj:
      Sk = 'G'
    else:
      Sk = 'B'
    for k in range(j+1, len(S)):
      # RGBのどれかになるはず
      if Sk == S[k]:
        if j - i != k - j:
          count += 1
print(count)

Fixed submission:
N = int(input())
S = input()
assert len(S) == N
count = 0

# j-i = k-jを探す
for i in range(0, len(S)-2):
  for j in range(i+1, len(S)-1):
    k = j + (j - i)
    if k < len(S):
      if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
        count += 1
numR = 0
numG = 0
numB = 0
for s in S:
  if s == 'R':
    numR += 1
  elif s == 'G':
    numG += 1
  else:
    numB += 1

print(numR * numG * numB - count)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
assert len(S) == N
count = 0
for i in range(0, len(S)-2):
  for j in range(i+1, len(S)-1):
    if S[i] == S[j]:
      continue
    SiSj = Si + Sj
    if 'R' not in SiSj:
      Sk = 'R'
    elif 'G' not in SiSj:
      Sk = 'G'
    else:
      Sk = 'B'
    for k in range(j+1, len(S)):
      # RGBのどれかになるはず
      if Sk == S[k]:
        if j - i != k - j:
          count += 1
print(count)

Fixed submission:
N = int(input())
S = input()
assert len(S) == N
count = 0

# j-i = k-jを探す
for i in range(0, len(S)-2):
  for j in range(i+1, len(S)-1):
    k = j + (j - i)
    if k < len(S):
      if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
        count += 1
numR = 0
numG = 0
numB = 0
for s in S:
  if s == 'R':
    numR += 1
  elif s == 'G':
    numG += 1
  else:
    numB += 1

print(numR * numG * numB - count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
assert len(S) == N
count = 0
for i in range(0, len(S)-2):
  for j in range(i+1, len(S)-1):
    for k in range(j+1, len(S)):
      if S[i] == S[j]:
        continue
      if S[i] == S[k]:
        continue
      if S[j] == S[k]:
        continue
      if j - i == k - j:
        continue
      count += 1
print(count)

Fixed submission:
N = int(input())
S = input()
assert len(S) == N
count = 0

# j-i = k-jを探す
for i in range(0, len(S)-2):
  for j in range(i+1, len(S)-1):
    k = j + (j - i)
    if k < len(S):
      if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
        count += 1
numR = 0
numG = 0
numB = 0
for s in S:
  if s == 'R':
    numR += 1
  elif s == 'G':
    numG += 1
  else:
    numB += 1

print(numR * numG * numB - count)
Buggy python submission (verdict: Runtime Error):
N, M =  map(int, input().split())
A = list(map(int, input().split()))
assert len(A) == N
# 商品iは得票Ai
# 総得票数の1/4M以上の商品をM個選ぶ
total = sum(A)
thres = math.ceil(total / (4 * M))
count = len([i for i in range(N) if A[i] >= thres])
if count >= M:
  print('Yes')
else:
  print('No')

Fixed submission:
N, M =  map(int, input().split())
A = list(map(int, input().split()))
assert len(A) == N
# 商品iは得票Ai
# 総得票数の1/4M以上の商品をM個選ぶ
total = sum(A)
import math
thres = math.ceil(total / (4 * M))
count = len([i for i in range(N) if A[i] >= thres])
if count >= M:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
# K > 1 かつ　N > Kの場合は、N - N // K * K をスタートにできる
if K > 1:
  N = N - N // K * K
else:
  N = 0
minimum = N
count = 0
#print(N)
while count <= N / 4:
  N = abs(N - K)
  minimum = min(N, minimum)
  count += 1
print(minimum)

Fixed submission:
N, K = map(int, input().split())
# K > 1 かつ　N > Kの場合は、N - N // K * K をスタートにできる
if K > 1:
  N = N - N // K * K
else:
  N = 0
minimum = N
count = 0
#print(N)
while count <= N / K:
  N = abs(N - K)
  minimum = min(N, minimum)
  count += 1
print(minimum)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
# K > 1 かつ　N > Kの場合は、N - N // K * K をスタートにできる
if K > 1:
  N = N - N // K * K
else:
  N = 0
minimum = N
count = 0
#print(N)
while count < N:
  N = abs(N - K)
  minimum = min(N, minimum)
  count += 1
print(minimum)

Fixed submission:
N, K = map(int, input().split())
# K > 1 かつ　N > Kの場合は、N - N // K * K をスタートにできる
if K > 1:
  N = N - N // K * K
else:
  N = 0
minimum = N
count = 0
#print(N)
while count <= N / K:
  N = abs(N - K)
  minimum = min(N, minimum)
  count += 1
print(minimum)
Buggy python submission (verdict: Time Limit Exceeded):
K, N = map(int, input().split())
A = sorted(map(int, input().split()))
assert len(A) == N


dists = []
for i,start in enumerate(A):
  # 右回り
  posR = max([a + K for a in A[:i]] + A[i+1:])
  # 左回り
  posL = min(A[:i] + [a - K for a in A[i+1:]])
  dists.append(min(posR - start, - posL + start))
print(min(dists))

Fixed submission:
K, N = map(int, input().split())
A = sorted(map(int, input().split()))
assert len(A) == N


dists = []
for i,start in enumerate(A):
  # 右回り
  posR = A[(i - 1) % N] + (K if A[(i - 1) % N] < start else 0)
  #max([a + K for a in A[:i]] + A[i+1:])
  # 左回り
  posL = A[(i + 1) % N] - (K if A[(i + 1) % N] > start else 0)
  #posL = min(A[:i] + [a - K for a in A[i+1:]])
#  print(start, posL, posR)
  dists.append(min(posR - start, - posL + start))
#print(dists)
print(min(dists))
Buggy python submission (verdict: Runtime Error):
N, K, Q = map(int, input().split())
A = tuple([int(input()) for q in range(Q)])
# N人参加、初期状態で全員がKポイント
# 誰かが正解すると、それ以外の全員が1ポイント下がる
# i番目に正解したのはAi
counts = [0 for i in range(Q)]
for a in A:
  counts[a-1] += 1

for i in range(N):
  print('Yes' if (K - (Q - counts[i])) >= 1 else 'No')

Fixed submission:
N, K, Q = map(int, input().split())
A = tuple([int(input()) for q in range(Q)])
# N人参加、初期状態で全員がKポイント
# 誰かが正解すると、それ以外の全員が1ポイント下がる
# i番目に正解したのはAi
counts = [0 for i in range(N)]
for a in A:
  counts[a-1] += 1

for i in range(N):
  print('Yes' if (K - (Q - counts[i])) >= 1 else 'No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
l=[]
for i in range(n):
  a,b = list(map(int,list(input().split())))
  l.append([a,b])
def fn(n,l):
  for i in range(n-2):
    if l[i][0]==l[i][1] and l[i+1][0]==l[i+1][1] andl[i+2][0]==l[i+2][1]:
      return 'Yes'
  return 'No'  
print(fn(n,l))
  

Fixed submission:
n = int(input())
l=[]
for i in range(n):
  a,b = list(map(int,list(input().split())))
  l.append([a,b])
def fn(n,l):
  for i in range(n-2):
    if l[i][0]==l[i][1] and l[i+1][0]==l[i+1][1] and l[i+2][0]==l[i+2][1]:
      return 'Yes'
  return 'No'  
print(fn(n,l))
Buggy python submission (verdict: Runtime Error):
n = int(input())
print(x^1)

Fixed submission:
x = int(input())
print(x^1)

Buggy python submission (verdict: Runtime Error):
x = int(input())
pint(x^1)

Fixed submission:
x = int(input())
print(x^1)

Buggy python submission (verdict: Runtime Error):
x = int(input())
if x==1:
  print(0)
else:
  print(1

Fixed submission:
x = int(input())
print(x^1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
x = n*(n-1)%1000000007
y = 10**(n-2)%1000000007
print((x*y)%1000000007

Fixed submission:
n = int(input())
r = (10**n)-2*(9**n)+8**n
r%=(10**9+7)
print(r)
Buggy python submission (verdict: Runtime Error):
import math

a,b,c = input().split()

left = int(a) + int(b)
right = int(c)

a = math.sqrt(int(a))
b = math.sqrt(int(b))
#c = math.sqrt(int(c))

left = left + 2*a*b


ans = ""

if(left< right):
    ans = "Yes"
else:
    ans = "No"

print(ans)

Fixed submission:
Term = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K = int(input())
print(Term[K-1])

Buggy python submission (verdict: Runtime Error):

H , W = input().split()
W = int(W)
H = int(H)
ans = int(0)

#Wが偶数なら(W//2)*H
#W.Hが奇数なら((W+1)//2)*((H+1)//2) + ((W - 1)//2*(H - 1)//2)
#Wが奇数Hが偶数(W+1)//2*(H//2) + ((W - 1)//2)*(H//2)

if(W == 1 or H == 1):
    ans = 1
elif(W%2 == 0):
    ans = (W//2)*H
elif(W%2 == 1 and H%2==1):
    ans = (((W+1)//2)*((H+1)//2)) + (((W - 1)//2)*((H - 1)//2))
elif(W%2 == 1 and H%2 ==0):
    ans = (((W+1)//2)*(H//2)) + (((W - 1)//2)*(H//2))
print(ans)

Fixed submission:
Term = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K = int(input())
print(Term[K-1])
Buggy python submission (verdict: Runtime Error):

H , W = input().split()
W = (W)
H = int(H)
ans = int(0)

#Wが偶数なら(W//2)*H
#W.Hが奇数なら((W+1)//2)*((H+1)//2) + ((W - 1)//2*(H - 1)//2)
#Wが奇数Hが偶数(W+1)//2*(H//2) + ((W - 1)//2)*(H//2)

if(W == H == 1):
    ans =1
elif(W%2 == 0):
    ans = (W//2)*H
elif(W%2 == 1 and H%2==1):
    ans = (((W+1)//2)*((H+1)//2)) + (((W - 1)//2)*((H - 1)//2))
elif(W%2 == 1 and H%2 ==0):
    ans = (((W+1)//2)*(H//2)) + (((W - 1)//2)*(H//2))
print(ans)

Fixed submission:

H , W = input().split()
W = int(W)
H = int(H)
ans = int(0)

#Wが偶数なら(W//2)*H
#W.Hが奇数なら((W+1)//2)*((H+1)//2) + ((W - 1)//2*(H - 1)//2)
#Wが奇数Hが偶数(W+1)//2*(H//2) + ((W - 1)//2)*(H//2)

if(W == 1 or H == 1):
    ans = 1
elif(W%2 == 0):
    ans = (W//2)*H
elif(W%2 == 1 and H%2==1):
    ans = (((W+1)//2)*((H+1)//2)) + (((W - 1)//2)*((H - 1)//2))
elif(W%2 == 1 and H%2 ==0):
    ans = (((W+1)//2)*(H//2)) + (((W - 1)//2)*(H//2))
print(ans)
Buggy python submission (verdict: Runtime Error):
import math

a,b,c = map(int,input().split())
ans = ""

if(c -a - b < 0 and 4*a*b>(c-a-b)*)*(c-a-b)):
    ans = "Yes"
else:
    ans = "No"

print(ans)



Fixed submission:
import math

a,b,c = map(int,input().split())
ans = ""

if((4*a*b)<(c-a-b)*(c-a-b) and c-a-b>0):
    ans = "Yes"
else:
    ans = "No"

print(ans)

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

a,b,c = input().split()

ans = ""

if(c -a - b < 0 and 4*a*b>(c-a-b)*)*(c-a-b)):
    ans = "Yes"
else:
    ans = "No"

print(ans)



Fixed submission:
import math

a,b,c = map(int,input().split())
ans = ""

if((4*a*b)<(c-a-b)*(c-a-b) and c-a-b>0):
    ans = "Yes"
else:
    ans = "No"

print(ans)

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

a,b,c = input().split()

left = a + b
right = c

a = math.sqrt(int(a))
b = math.sqrt(int(b))
#c = math.sqrt(int(c))

left = left + 2*a*b


ans = ""

if(left< right):
    ans = "Yes"
else:
    ans = "No"

print(ans)

Fixed submission:
import math

a,b,c = map(int,input().split())
ans = ""

if((4*a*b)<(c-a-b)*(c-a-b) and c-a-b>0):
    ans = "Yes"
else:
    ans = "No"

print(ans)
Buggy python submission (verdict: Runtime Error):
Flag =  0 
S = input()
SA = [str(c) for c in S]
#A = list(['A','A','A'])
#B = list(['B','B','B'])
S1 = SA[1]
S2 = SA[2]
S3 = SA[3]
if(S1 == S2 == S3):
    print("No")
else:
    print("Yes")

Fixed submission:
Flag =  0 
S = input()
SA = [str(c) for c in S]
#A = list(['A','A','A'])
#B = list(['B','B','B'])
S1 = SA[0]
S2 = SA[1]
S3 = SA[2]
if(S1 == S2 == S3):
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
Flag =  0 
after = ""
S = input().split()
A = list("A","A","A")
B = list("B","B","B")
if(set(S) == set(A) or set(S) ==set(B)):
    print("No")
else:
    print(print("Yes")

Fixed submission:
Flag =  0 
S = input()
SA = [str(c) for c in S]
#A = list(['A','A','A'])
#B = list(['B','B','B'])
S1 = SA[0]
S2 = SA[1]
S3 = SA[2]
if(S1 == S2 == S3):
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
Flag =  0 
after = ""
S = input().split()
if(all(S)):
    print("No")
else:
    print(print("Yes")

Fixed submission:
Flag =  0 
S = input()
SA = [str(c) for c in S]
#A = list(['A','A','A'])
#B = list(['B','B','B'])
S1 = SA[0]
S2 = SA[1]
S3 = SA[2]
if(S1 == S2 == S3):
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
N = input()
if N%2 ==0:
  print(N/2)
else:
  print(N/2 + 1)

Fixed submission:
N = input()
intN=int(N)
if intN%2 == 0:
    print(intN//2)
else:
    print(intN//2 +1)

Buggy python submission (verdict: Runtime Error):
N = input();
if N%2==0:
  print(N/2)
else:
  print(N/2 + 1)

Fixed submission:
N = input()
intN=int(N)
if intN%2 == 0:
    print(intN//2)
else:
    print(intN//2 +1)
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().parse())
print(max([a*b,c*d]))

Fixed submission:
a,b,c,d=map(int,input().split())
print(max([a*b,c*d]))

Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().parse())
print(max(a*b,c*d))

Fixed submission:
a,b,c,d=map(int,input().split())
print(max([a*b,c*d]))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().split())
ans = 1
for i in a:
    ans *= i
if ans > 1e18:
    print(-1)
else:
    print(ans)


Fixed submission:
a, b = map(int, input().split(" "))
print(a*b)